How do I correctly use Paster plugin for a minimap

Get help using Construct 2

Post » Sun Feb 28, 2016 8:43 pm

Hello,

I'm trying to draw a minimap with the Paster plugin but I have difficulties.
First I populate an array with random values for the map, and fill a tilemap in the same way at the same time.
Next I run through the same array and draw 1x1 quads with a color for each value.

https://www.dropbox.com/s/nh1756hzw2rgnub/PasterMinimapTilemap.capx?dl=0

The result is a minimap opposite of the real map. And some strange things I don't understand. I don't see any option to close path. Do I have to set the vertices of the quad ?

@R0J0hound

What did I do wrong ? Something with the order I call Set Quad Color ?

Edit : After testing, trying to run through a tilemap loop instead of array, trying to make two passes instead of one, I've seen unpredictable results. For example, if I disable the second color for the minimap, it works well. So it draws the quads at the right location, red 1x1 quad at black tile. But with the second condition, the results are wrong. If I set a first pass for the red quads at black tile, and a second for white quads at gold tiles, it makes some weird results. Really don't understand anything...
B
14
S
4
Posts: 112
Reputation: 1,287

Post » Tue Mar 01, 2016 1:41 am

I took a look and the events look correct. I don't use webgl so if there's a webgl related issue I won't see it. The minimap was oriented correctly, but the colors were faded except for the right and bottom edge. I have no idea why that occurs, but using a "additive" blend is on solution.

Edit:
Fixed the faded issue in the plugin.
B
94
S
33
G
117
Posts: 5,388
Reputation: 75,337

Post » Tue Mar 01, 2016 1:57 pm

Hey @R0J0hound,

I was using WebGL, and the problem doesn't occur anymore when I disabled it. Everything is correctly drawn without it. So you're right it's related to WebGL. So what can I do ? I used the Paster plugin because of that, in comparaison with Canvas.
B
14
S
4
Posts: 112
Reputation: 1,287

Post » Tue Mar 01, 2016 5:28 pm

@Nabu0001

You could go at it from another angle. You could use a 1x1 sprite and just paste that, or you could just use a tiny tilemap instead of the paster object. If the map doesn't change you could also use the canvas plugin, since it only has a performance hit with webgl if you constantly change the texture.
B
94
S
33
G
117
Posts: 5,388
Reputation: 75,337

Post » Tue Mar 01, 2016 5:41 pm

@R0J0hound,

I didn't think of tiny tilemap, or pasting a little sprite. Thanks for the tip.
It is a bug in your plugin using WebGL ? Or does it come from WebGL only ? It's strange.

Thanks for your help.
B
14
S
4
Posts: 112
Reputation: 1,287

Post » Tue Mar 01, 2016 5:59 pm

It's probably a bug in my code, but I can't test it without the webgl renderer being used.
B
94
S
33
G
117
Posts: 5,388
Reputation: 75,337


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 6 guests