[PLUGIN] Canvas

Post your completed addons to share with the community

Post » Sun Apr 06, 2014 6:25 pm

@Pode weird, your fill color example dont work corectly. its hard to pick colour and fill white field
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sun Apr 13, 2014 5:47 am

Is there any way to use the canvas graphic form as a collision polygon shape?

Many thanks :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Thu Apr 17, 2014 8:04 pm

@r0j0hound

Thanks for this awesome plugin. I have a question thought. Is it possible to first paste layer to canvas, then chop that image in to even size tiles ( basically chop an image in to pieces) and load them one by one in to sprites?

Also, if I copy to canvas, and canvas is on layout, it will show that image, right? I'm asking because I'm doing some tests with it and I'm bit confused on how it works.

Thanks!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Fri Apr 18, 2014 6:20 pm

@xeed
You can't change the collision polygon with this. It is possible to do per-pixel collisions by accessing the pixel data, although it is pretty slow. It doesn't work with polygon collisions so other work would be needed to make them work together. There is an example on the forum of per-pixel collision that uses the tilemap object with 1x1 tiles. It still is a bit slow but it does work with polygon collisions.

@megatronx
For the first part you can split it up by pasting the larger canvas onto a smaller one. If you resize the canvas objects in the event sheet you may also need to use the "resize canvas" action to change the canvas' texture size as well.

For the second part, yes the canvas object should be drawn.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Fri Apr 18, 2014 6:33 pm

Thanks!
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
71
S
19
G
19
Posts: 1,919
Reputation: 16,910

Post » Fri Apr 18, 2014 7:04 pm

@ROJOhound , something that i was meaning to ask about canvas use

using sprites for tiles..
and using the process of switch tileframe from arrayposition (create and show only tiles in view)
could the same process be used/combined with canvas. actually making a looping texture from tilespasting

for seamissues, is it possible to paste relative to canvasorigin, so the texture is composed of non floats
(seams in floats are actually the main issue here)

would this be is it a realistic aproach, performance, technical? any insights?
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Fri Apr 18, 2014 7:23 pm

@vtrix
You could use the canvas for that. You want to be able to change the tile graphics at runtime right?
One thing to keep in mind is you should only have only one canvas instance per texture to save vram and just position and paste into every location.

The "paste" action already does the relevant calculations so the pasted object at the correct location on the canvas. As far as seams, if they show up you could make the tiles slightly bigger so they overlap a bit.

For performance the tilemap object would be the best way to go, but you do get more flexibility using the canvas.
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

Post » Fri Apr 18, 2014 7:52 pm

yes, indeed at runtime, one texture was what i had in mind, so it would combine about 30+ sprites in one texture
still getting my head around, converting the same tiletechnique to one texture,would i need to redraw the full texture or only a part?
thanks for the answer, i need to invest some time in the idea...
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Tue Apr 22, 2014 2:02 pm

Hello @R0J0hound

Following your trail example http://dl.dropbox.com/u/5426011/examples%208/canvasTrail.capx I tried to replicate the trail effect http://www.eli0s.com/Tests/TowerLaser.capx and I was wondering why there is a trace left visible behind? Shouldn't the destination out object add to its self to the point that the trail is completely transparent?

In an other case, I tried to fill the canvas with a color ("rbga(0,0,0,0.1)"), the canvas does get darker and darker but the same kind of trace is being left behind.

Any ideas? Does this happens to anybody else? Am I doing something wrong here, because even on R0J0hound example the same thing happens?

Thanks!
composer - multimedia artist
www.eli0s.com/en/
B
53
S
21
G
3
Posts: 1,126
Reputation: 8,093

Post » Tue Apr 22, 2014 10:37 pm

I goes completely transparent for me on my computer. I don't know why it wouldn't... Does it fade at all?
B
79
S
24
G
54
Posts: 4,743
Reputation: 40,749

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests