Need some help with Arrays

Get help using Construct 2

Post » Fri Aug 03, 2012 8:06 am

Hi. I'm just starting to learn Construct 2. Switching from XNA.
Basically what I am trying to do is create a 8x8 object I'll call "PixelGrid". I need to be able to keep track of and update each PixelCell's settings such as color in the PixelGrid. Right now I'm using the Canvas plugin. My question is:

Is there a way to manipulate the pixels of a sprite? If not, do you think using the Canvas Plugin + Array to do this is a good way to go? Any suggestions?

Thanks!

B
6
S
1
Posts: 31
Reputation: 1,237

Post » Sun Aug 05, 2012 2:36 am

bump. still stumped :P
B
6
S
1
Posts: 31
Reputation: 1,237

Post » Sun Aug 05, 2012 3:37 am

If its just an 8x8 pixel image then the Canvas object should be able to handle it all by itself as it is an array all on its own.

Just remember it uses relative coordinates, and to get a specific color use rgbaAt(x,y).
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sun Aug 05, 2012 8:24 am

Thanks for your answer. Do you know if there is a way to give a Canvas Element collision events like Sprites? It seems it has everything a sprite does except collision...
B
6
S
1
Posts: 31
Reputation: 1,237

Post » Sun Aug 05, 2012 8:43 am

There's a modified version that can do box collisions:
http://www.scirra.com/forum/plugin-canvas_topic46006_post325341.html#325341

Otherwise a dummy sprite should be fairly suitable.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to How do I....?

Who is online

Users browsing this forum: alextro, MarkStockley and 0 guests