256 Colour Tutorial Part 2(V2.62): Difference between revisions

m
Line 32: Line 32:
Don't get confused, yet, it's not really that hard, let me demonstrate it with an example. You may still remember that I made [[media:8bittut_dizzy.pcx|this background]] in Part 1, and its palette is like:
Don't get confused, yet, it's not really that hard, let me demonstrate it with an example. You may still remember that I made [[media:8bittut_dizzy.pcx|this background]] in Part 1, and its palette is like:


[[Image:8bittut_dizzypal.png]]
[[Image:8bittut_dizzypal.png|center|Dizzy background palette]]


You may have noticed that, I used the "rainbow" colours in slots #240 through #253 (the first 14 slots in the last line of the above palette) to draw the "warping frame" of the background, if the colours of these slots are altered the colours of that "warping frame" will be changed accordingly (you can load the background into a graphics programme and play with the colours of these slots and see what will happen). To make an animated effect, you may try using the function '''CyclePalette()''' with ''starting slot'' #240 and ''ending slot'' #253. Here's a graphical illustration of what will happen if you do that:
You may have noticed that, I used the "rainbow" colours in slots #240 through #253 (the first 14 slots in the last line of the above palette) to draw the "warping frame" of the background, if the colours of these slots are altered the colours of that "warping frame" will be changed accordingly (you can load the background into a graphics programme and play with the colours of these slots and see what will happen). To make an animated effect, you may try using the function '''CyclePalette()''' with ''starting slot'' #240 and ''ending slot'' #253. Here's a graphical illustration of what will happen if you do that:


[[Image:8bittut_dizzypalcp.png]]
[[Image:8bittut_dizzypalcp.png|Diagram illustrating the effect of CyclePalette()]]


Whenever the function CyclePalette(240, 253) is executed, the colours in these slots are shifted to the left by one slot, and the original colour in the first slot (#240) will be warped to the last slot (#253).
Whenever the function CyclePalette(240, 253) is executed, the colours in these slots are shifted to the left by one slot, and the original colour in the first slot (#240) will be warped to the last slot (#253).