possible to...how to...

This forum is currently in read-only mode.
  • 1. change sprite distort map info through another plugin? given a pointer* to a sprite

    2. get top left corner of sprite through another method besides object->info.x-object->info.hotspotx, object->info.y-object->info.hotspoty?

    3.get imagepoint location?

    4.set the current animation frame?

    5. and what is hotspotangle?

  • 1. Eh, it'd be difficult, you'd need changes to the Sprite object really. What do you want to do?

    2. There is no "left corner". Do you mean the top left corner or bottom left corner? Of the sprite box or the bounding box? What's wrong with the code you posted anyway?

    3. See the following functions in VRuntime:

    	virtual bool			GetImagePoint(CRunObject* obj, int number, POINTF& pt) = 0;
    	virtual bool			GetImagePoint(CRunObject* obj, const char* pointName, POINTF& pt) = 0;[/code:2d3trdro]
    
    4.  object->info.curAnim->curFrame or similar.  Check curAnim is not NULL.  You might need a call to UpdateAnimation or similar after it.  Check the Sprite object source to see how it does it.
    
    5.  An unused leftover from a failed idea.
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thanks ash

    1. Eh, it'd be difficult, you'd need changes to the Sprite object really. What do you want to do?

    two things, first for the bitmapped text object (sprite lettering), I was hoping to let the user setup up a text box, so the text display would be limited to a rotatable box,

    like a traditional text box, if the text was longer than fit into the box it could be partially obscured or not visible, and then they could scroll text across to bring it into and out of visibility like a scrolling marquee

    the second was for my personal plugin project, I wanted to be able to setup complex distort map functions that constantly update sprites. I suppose it's possible to do with events, by having the plugin have distortion specific expressions, and then "always" - set distortion to those expressions, but that's a little messier than the way the rest of the plugin works,

    and as far as the first usage, (with the scrolling text box), that plugin is for widespread use, and I'd prefer not to make the user have to take extra steps to make the plugin do what it's supposed to.

    [quote:28kdgq8t]

    2. There is no "left corner". Do you mean the top left corner or bottom left corner?

    yeah, I meant to type top left

    [quote:28kdgq8t]

    Of the sprite box or the bounding box?

    I don't think I know the difference

    [quote:28kdgq8t]

    What's wrong with the code you posted anyway?

    nothing, but if there was a function that returned the topleft corner, I would rather do that

  • nothing, but if there was a function that returned the topleft corner, I would rather do that

    You could make an inline function or macro if you're really into tidy code .

  • I don't see why you need distort maps for a scrolling marquee... it sounds like you can do that just moving the objects around.

    The top left of the object box is like the top left corner of the selection box in the layout editor - it rotates with the object. The bounding box never rotates, it's an unrotated box big enough to fit in the whole rotated object. Still, if the current calculation works absolutely fine... why are you asking?

    Also I'd hope you use a function instead of a macro for that calculation!

  • i was going to use the distort map for letters that were partially cut off by the edge of the text box as they scrolled into and out of view

    thanks for the info about the bounding boxes.

    i was asking just to make sure im following sdk conventions:),

    and as far as macros, after explaining how they worked, david told me about your and general c++ dev community's (but especially your ) opinion on macros. i don't intend to use them, intellisense seems to work much better with functions and constants than macros anyway

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)