How do I have multiple sprite-font objects share one image?

  • If I'm using more than one sprite-font object which all look exactly the same, Construct 2 saves separate spritesheets for each object. I want them to all share the same spritesheet obviously.

    The font uses a fairly high-resolution image so it's kind of important I'm not saving loads of duplicates of it.So how do I have multiple objects share one image? please help omg

  • Why use multiple objects?

    Just use instances of the same object and your issue is resolved..

  • Why use multiple objects?

    Just use instances of the same object and your issue is resolved..

    But then the programming gets really messy. I'd have to use instance variables to say which instance has which job, and then specify which instance I want every time I get any of them to perform an action and ugh

    Not happening

  • Ok..

    A perfectly fine solution rejected..

  • > Why use multiple objects?

    > Just use instances of the same object and your issue is resolved..

    >

    But then the programming gets really messy. I'd have to use instance variables to say which instance has which job, and then specify which instance I want every time I get any of them to perform an action and ugh

    Not happening

    Actually maybe that wouldn't be too tough. But still, there must be a way to have objects share artwork. Anyone?

  • Actually maybe that wouldn't be too tough.

    It wouldn't..

    Just give the spritefont a text instance variable "Function"

    Spritefont compare variable "Function" = "Highscore"

    spritefont set text to : Highscore

    Spritefont compare variable "Function" = "Time"

    spritefont set text to : Time

    etcetera..

  • It also means I have to set font scale, character spacing and every other value for each instance I create, rather than Construct 2 just sorting that all out based on an instance of the same object elsewhere in the project if you know what I mean. Kinda annoying.

    Oh well! Thanks for the help.

  • So is there really no way of having objects share artwork in Construct 2?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It also means I have to set font scale, character spacing and every other value for each instance I create, rather than Construct 2 just sorting that all out based on an instance of the same object elsewhere in the project if you know what I mean. Kinda annoying.

    Oh well! Thanks for the help.

    A simple on created action would solve this..

    If you are using the same image, wouldn't the spacing be the same for each object?

  • Spritefont doesn't have "the load image from url" action, otherwise that would be a possibility..

  • A simple on created action would solve this..

    I mean when I use the 'create object' action.

  • I'm pretty sure C2 has image deduplication. They might have seperate sprites but when you export the engine will know to use the same image for both.

  • Yep.. One event..

    Spritefont on created

    add all actions to set the spacing

    Works for me..

    Every spritefont created automatically has the right spacing..

  • I'm pretty sure C2 has image deduplication. They might have seperate sprites but when you export the engine will know to use the same image for both.

    awesome

  • Ok..

    A perfectly fine solution rejected..

    I really appreciated your idea, you saved my work!

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