Drag & Drop behavior on panel + bitmap Font

This forum is currently in read-only mode.
From the Asset Store
Horror Halloween Pixel Art Sprite Font Space Data included
  • Hello,

    I have a problem here. I created a test Panel object and it seems that when i use the drag&drop behavior on the 'panel' i created, the caption text isn't moving with it. I attached the the bitmap font (spriteFont) with the panel, it is not moving with it.

    Does anyone have this same particular problem? Is there a possible solution for this?

    http://dl.dropbox.com/u/552137/Classic/CityMania.cap

  • When you're posting a dropbox link you need to put your file into the Public folder of your Dropbox folder, and right-click on it and select "Copy public link."

    Or if you're using the web interface you click the down-arrow at the end of your file in the Public folder and select "Copy public link." That's the link you post.

    The one you posted is the secure link to the file from your web login, we can't download that, so I can't see what's in your .cap.

    Anyway, when you use the Attach action for the panel to attach another object, you don't move the panel, it's the other way around. You move the object, and the panel follows it. But you can't add a behavior to SpriteFont, so you can't set it to Drag and Drop.

    So if you want to drag and drop a panel and have the text remain inside, you need to use the Attach action in the SpriteFont object. But just setting the position isn't enough, you need to refresh the text inside it:

    + Always
        -> SpriteFont: Attach to Panel
        -> SpriteFont: Show text "Hello world!"
    [/code:386znf11]
    
    Now you can drag the panel around normally and the text will follow.  The "Show text" action every tick will update the position of the sprites in the SpriteFont object.  Otherwise, it just puts the sprites on the screen in one spot and leaves them there until you do something else with them.
    
    Normally you don't have to use "Show text" every tick, only if you're moving the SpriteFont object around.
    
    Attaching the panel every tick might seem like overkill, but if you don't then the text will lag behind the panel when you drag it.  This fixes the issue, the text will remain firmly inside the panel.  Normally, if your panel doesn't ever move, you would only need to attach it once.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey deadeye,

    Thank you for your huge reply.

    When i do a "show text" inside the allways condition, the game crashes :

    The link is: http://dl.dropbox.com/u/552137/Classic/CityMania.cap

  • Hmm... I don't know what's going on there. When I tested it out in my own .cap, it worked fine. But in your .cap, I get the crash.

    Unfortunately, it looks like a bug with SpriteFont. I would ask lucid about it, but he's said in his SpriteFont thread that he's not going to be fixing things, but rather he would like to start writing the plugin again from scratch. It's not something that you can put on the bug tracker because the Construct devs didn't make SpriteFont. I don't know what to tell you, I'm sorry .

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