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

m
Line 78: Line 78:
Having done some sprites I think it's now time for me to make some backgrounds. First I make [[media:8bittut_dizzy.pcx|this background]], you may check out that its palette is like:
Having done some sprites I think it's now time for me to make some backgrounds. First I make [[media:8bittut_dizzy.pcx|this background]], you may check out that its palette is like:


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


Note that when I make a background I just save a sprite image ''as a different name'' (so it has all the sprite colours properly set), ''change it's size'' to the background size I need, ''clear'' it, and then start adding colours from ''the end'' of the palette, as they're supposed to be "'''room dependent'''", so you can paint your backgrounds with these slots and make them different in different backgrounds if necessary. Note also that the first half of the palette matches that of the sprites so I can still use the fixed colours in my backgrounds if necessary (just don't change their colours as you may have drawn some of the sprites with these slots already). Now you may try importing it as a room background. My test game used 320x240 as its default resolution, so the background is of this dimension. Go to "'''Room Editor --> Setting'''" of the AGS Editor, and click the '''Import background (exact palette)''' [[Image:8bittut_exactpal.png]] button (make sure you didn't click the '''Import background''' [[Image:8bittut_impbgbut.png]] button wrongly, note also that these two actions are now moved to the '''Room''' dropdown menu since AGS V2.7), the background should be imported without any problem. '''NOW''' (that is, you didn't restart the editor, start/load a new room, etc.) if you select the last few rows of slots in "'''Palette Editor'''" and uncheck the "'''This colour is room-dependent'''" box you'll see that the colours are imported perfectly like in the original image:
Note that when I make a background I just save a sprite image ''as a different name'' (so it has all the sprite colours properly set), ''change it's size'' to the background size I need, ''clear'' it, and then start adding colours from ''the end'' of the palette, as they're supposed to be "'''room dependent'''", so you can paint your backgrounds with these slots and make them different in different backgrounds if necessary. Note also that the first half of the palette matches that of the sprites so I can still use the fixed colours in my backgrounds if necessary (just don't change their colours as you may have drawn some of the sprites with these slots already). Now you may try importing it as a room background. My test game used 320x240 as its default resolution, so the background is of this dimension. Go to "'''Room Editor --> Setting'''" of the AGS Editor, and click the '''Import background (exact palette)''' [[Image:8bittut_exactpal.png|Import background (exact palette) button]] button (make sure you didn't click the '''Import background''' [[Image:8bittut_impbgbut.png|Import background button]] button wrongly, note also that these two actions are now moved to the '''Room''' dropdown menu since AGS V2.7), the background should be imported without any problem. '''NOW''' (that is, you didn't restart the editor, start/load a new room, etc.) if you select the last few rows of slots in "'''Palette Editor'''" and uncheck the "'''This colour is room-dependent'''" box you'll see that the colours are imported perfectly like in the original image:


[[Image:8bittut_dizzpala.png]]
[[Image:8bittut_dizzpala.png|center|AGS palette after importing Dizzy background]]


(Don't forget to set these colours back to "'''room-dependent'''" after checking, otherwise your next background may not be imported perfectly.)
(Don't forget to set these colours back to "'''room-dependent'''" after checking, otherwise your next background may not be imported perfectly.)
It's time for me to try out how it'll look like in a compiled game now:
It's time for me to try out how it'll look like in a compiled game now:


[[Image:8bittut_dizzygam.png]]
[[Image:8bittut_dizzygam.png|center|Dizzy room screenshot]]


I had added the two imported sprites as objects to check if things went smoothly, note that the girl's sprite was imported perfectly as her antenna are intact and are not "eaten" by the dark transparent colour during import. This is one importance of using exact palette import.
I had added the two imported sprites as objects to check if things went smoothly, note that the girl's sprite was imported perfectly as her antenna are intact and are not "eaten" by the dark transparent colour during import. This is one importance of using exact palette import.
Line 93: Line 93:
I am happy, so I draw [[media:8bittut_disco.pcx|one more background]], this time the palette is like:
I am happy, so I draw [[media:8bittut_disco.pcx|one more background]], this time the palette is like:


[[Image:8bittut_discopal.png]]
[[Image:8bittut_discopal.png|center|AGS palette after importing Disco background]]


Obviously the colours assigned for this background are different from the last one, that's how "'''room-dependent'''" slots work.
Obviously the colours assigned for this background are different from the last one, that's how "'''room-dependent'''" slots work.
Line 105: Line 105:
If you place the sprite as an object in the room you'll find out whether it's imported properly (if you try putting it in the "dizzy" room, you may find it looking funny, since the two room backgrounds used different colours):
If you place the sprite as an object in the room you'll find out whether it's imported properly (if you try putting it in the "dizzy" room, you may find it looking funny, since the two room backgrounds used different colours):


[[Image:8bittut_discogam.png]]
[[Image:8bittut_discogam.png|center|Disco room screenshot]]


Note that I also placed roger in the room for comparison, and he looks ''real'' funny, like a zombie, that's because I changed the colours of slots #17 through #41 when I first set up the palette, so if you want to keep CJ's original roger and GUI, etc. sprites intact you shouldn't change them.
Note that I also placed roger in the room for comparison, and he looks ''real'' funny, like a zombie, that's because I changed the colours of slots #17 through #41 when I first set up the palette, so if you want to keep CJ's original roger and GUI, etc. sprites intact you shouldn't change them.