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

Get help using Construct 2

Post » Sun Oct 18, 2015 2:28 pm

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
B
8
S
1
Posts: 54
Reputation: 824

Post » Sun Oct 18, 2015 2:33 pm

Why use multiple objects?
Just use instances of the same object and your issue is resolved..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 18, 2015 2:38 pm

LittleStain wrote: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
Last edited by Sam Mortimer on Sun Oct 18, 2015 2:45 pm, edited 2 times in total.
B
8
S
1
Posts: 54
Reputation: 824

Post » Sun Oct 18, 2015 2:43 pm

Ok..

A perfectly fine solution rejected..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 18, 2015 2:46 pm

Sam Mortimer wrote:
LittleStain wrote: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?
B
8
S
1
Posts: 54
Reputation: 824

Post » Sun Oct 18, 2015 2:56 pm

Sam Mortimer wrote: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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 18, 2015 3:18 pm

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. :)
B
8
S
1
Posts: 54
Reputation: 824

Post » Sun Oct 18, 2015 3:20 pm

So is there really no way of having objects share artwork in Construct 2?
B
8
S
1
Posts: 54
Reputation: 824

Post » Sun Oct 18, 2015 3:28 pm

Sam Mortimer wrote: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?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Oct 18, 2015 3:34 pm

Spritefont doesn't have "the load image from url" action, otherwise that would be a possibility..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: Mogador, NN81, sublimate and 9 guests