Reuse the font sprite graphics on more than one text

Discussion and feedback on Construct 2

Post » Wed Feb 04, 2015 11:07 pm

That's right. Just try it and see :D
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Feb 04, 2015 11:20 pm

Ok got it.

Thanks for your help.
It would be nice if you could see an the instances in your inspector and give them a name.
What tends to confuse me is that the Name property is the property of the object, not the instance.

It would be nice if you could name instances and have them available in your events sheets as if they were instance variables ( in ordinary programming )

This is whats confusing me.

Now you have to pick by uid, which you cant trust because they change, so you have to save these values in an array or dictionary, and it just makes the code hard to read I think.

So if any from the scirra team is reading this... Instance names, would be nice. :-)
B
5
S
1
Posts: 59
Reputation: 493

Post » Wed Feb 04, 2015 11:30 pm

hgr wrote:Ok got it.

Thanks for your help.
It would be nice if you could see an the instances in your inspector and give them a name.
What tends to confuse me is that the Name property is the property of the object, not the instance.

It would be nice if you could name instances and have them available in your events sheets as if they were instance variables ( in ordinary programming )

This is whats confusing me.

Now you have to pick by uid, which you cant trust because they change, so you have to save these values in an array or dictionary, and it just makes the code hard to read I think.

So if any from the scirra team is reading this... Instance names, would be nice. :-)


What name would you give to your instances? Remember instances can be dynamic, not just placed at design time. You can always add an instance variable yourself to identify it in the inspector (where you already can see the instances, numbered by IID). If you're still thinking as per traditional programming, you still need to do the 'paradigm shift' :)

I do agree it should be 'Type' not 'Name'
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Wed Feb 04, 2015 11:38 pm

Simple...

When I edit the code in the evnet sheet. It would be so nice if I could select the instances by name. Especially when you access instance variables..

InstanceName.instancevariable

Instead of now,

ObjectName.InstanceVariable.

If your instance is on the layout. It is declared as available in the game for your events. Sure it makes no sense if you spawn instances in events. But whey they are placed on the layout. It would be so nice If I could access them by name instead of IID (or UID)

And yes it is traditional programming, in Visual Stucio / xCode etc. And not drag and drop in Construct 2. :-)
B
5
S
1
Posts: 59
Reputation: 493

Post » Wed Feb 04, 2015 11:48 pm

hgr wrote:Simple...

When I edit the code in the evnet sheet. It would be so nice if I could select the instances by name. Especially when you access instance variables..

InstanceName.instancevariable

Instead of now,

ObjectName.InstanceVariable.

If your instance is on the layout. It is declared as available in the game for your events. Sure it makes no sense if you spawn instances in events. But whey they are placed on the layout. It would be so nice If I could access them by name instead of IID (or UID)

And yes it is traditional programming, in Visual Stucio / xCode etc. And not drag and drop in Construct 2. :-)


Fair enough. Somehow it becomes natural pretty quickly to do things the Construct way :) Usually when I have fixed objects in a layout they will have an ID value, and sometimes I do use that in a similar way. You could have a dummy Text instance variable with values like "top", "bottom", "this one" or whatever to identify them if you wanted . Or create a really simple Behaviour with a single property 'Instance name'.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Feb 05, 2015 8:51 am

@hgr If you want to use the same picture for different objects, let's say SpriteFont1 and SpriteFont2, then just import the picture (font) that you want to use to both, SpriteFont1 and SpriteFont2, and on export the image deduplication will make them use only 1 picture. Same thing with sprites, for more info, read the tutorial. And the status bar is not always right, because it just can't calculate what you get after deduplication and compression after export.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Thu Feb 05, 2015 11:01 am

@Sisyphus, you are so right. I realized it when I thought of the export folder. Only one single instance of the png picture. Duh! :)
B
54
S
17
G
10
Posts: 429
Reputation: 8,948

Post » Fri Feb 06, 2015 1:38 am

That is GREAT news.

However it would still be cool if you could reference the image file so if you made a change you would have a easier time refactoring the rest.

Perhaps we will see this in construct 3
B
5
S
1
Posts: 59
Reputation: 493

Post » Sat Feb 07, 2015 2:08 pm

hgr wrote:That is GREAT news.

However it would still be cool if you could reference the image file so if you made a change you would have a easier time refactoring the rest.

Perhaps we will see this in construct 3

If you change an original picture you can use "Reload from original source" in image editor to update it, but yeah, you need to do that for all objects.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests