Plugin features

For developers using the Construct 2 Javascript SDK

Post » Thu Nov 26, 2015 4:15 am

Can a world object have multiple textures on import?
If so, can they have different blend modes?
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Thu Nov 26, 2015 5:49 am

An object can either have one image like tiledbg or animations like Sprite defined with the pf_texture or pf_animations flags. Not sure if you can have it load more than one texture by default though.

As far as drawing goes you can draw the two textures any way you'd like at runtime. The edittime is more limited though. You'll have to look at the Sprite plugin to see how different animation frames are used for drawing in the editor. Also it doesn't look like you can control the blend modes for the editor from the sdk, but maybe I haven't looked well enough.
B
94
S
33
G
113
Posts: 5,354
Reputation: 73,269

Post » Thu Nov 26, 2015 12:27 pm

OK thanks.
Was thinking about some sort of generic gui plug that was pre configured to make it easier to make menu's etc, but if it can't do it as a default then it kind of defeats the purpose.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Thu Nov 26, 2015 7:19 pm

For something like a gui it's pretty common to have all the peices of the graphics in one texture.
B
94
S
33
G
113
Posts: 5,354
Reputation: 73,269

Post » Thu Nov 26, 2015 9:17 pm

But it's not possible to have a blend mode on only part of that texture right?
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Thu Nov 26, 2015 11:39 pm

Sure it is, just not in the editor from what I can tell. You can take a texture and draw one part of it to one quad and another part of it to another. 9patch is a good example of that. You can do that in the editor and at runtime.
The only limit is you can't set the blend mode with js in the editor. At runtime you can do that no problem, just set the blend mode before each quad drawn.
B
94
S
33
G
113
Posts: 5,354
Reputation: 73,269

Post » Fri Nov 27, 2015 12:53 am

Id say too bad we can't do that with tile maps, but you can't overlap the texture.
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests