Log In  

Can anybody explain to me the difference between "change color at draw time" and "change color at display time"? If I, for example, set red to green and than I draw a sprite, its reds are drawn as greens. If I set it to change at display time, the effect is the same. What's the difference between the two modes?

P#14756 2015-09-30 06:44 ( Edited 2015-10-14 10:09)

With the 3rd argument being 0, you're changing the color when you draw that given object. You're only changing it at that moment, and if you call pal() after that, it will go to default.

At display time, it changes for everything in the screen, so it can be used for effects that you want to affect all the rendered sprites, as Fade Out effects or stuff like that.


You draw sprites A and B. B is a recolor of A, using pal(x,y,0) to change the color x with the y.

After that, you use pal(x,y,1). This way everything using color x will use color y when its rendered on screen.

I believe this is the difference, if there's something wrong, please correct me :)

P#14757 2015-09-30 07:03 ( Edited 2015-09-30 11:03)

This is how I intended it, so I expect the following example to draw the last pixel (at 12, 12) with color 3 and not color 9, as I'm modifying it to change al render time. This doesn't seem to work on 0.1.2, though.

pset(10, 10, 8)
pal(8, 3)
pset(11, 11, 8)
pset(12, 12, 9)
pal(9, 3, 1)

EDIT: Nevermind, I got it wrong in the gode. Works as expected.

P#15373 2015-10-14 06:09 ( Edited 2015-10-14 10:21)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-09-23 11:30:21 | 0.006s | Q:11