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

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{deprecated}}
{{non-OOP}}
'''Basic Setups'''
'''Basic Setups'''
(by [[user:Gilbert|Gilbert Cheung]])
(by [[user:Gilbert|Gilbert Cheung]])
Line 5: Line 8:
First, here are some basic knowledge about 256 colour modes. You may skip the following paragraph if you think you know enough about them already.
First, here are some basic knowledge about 256 colour modes. You may skip the following paragraph if you think you know enough about them already.


Under 256 (8-bit) colour modes, each pixel on screen is stored as one byte (8-bit). Unlike the "'''Direct Colour'''" modes (15/16-bit hi-colour and 24/32-bit true-colour modes, 8-bit colour mode is an "'''Indiced Colour'''" mode) the contents of the 256 colour slots in 8-bit modes need ''not'' be fixed, but instead, each of the slots can be set to ''any'' of the available 262,144 colours at one time (the VGA/MCGA base palette), so you can make variations to the colours displayed to suit your needs.
Under 256 (8-bit) colour modes, each pixel on screen is stored as one byte (8-bit). Unlike the "'''Direct Colour'''" modes (15/16-bit hi-colour and 24/32-bit true-colour modes, 8-bit colour mode is an "'''Indiced Colour'''" mode) the contents of the 256 colour slots in 8-bit modes need ''not'' be fixed, but instead, each of the slots can be set to ''any'' of the available 262,144 colours (the VGA/MCGA base palette) at one time, so you can make variations to the colours displayed to suit your needs.


==Preparations==
==Preparations==
Line 80: Line 83:
[[Image:8bittut_dizzypal.png|center|Dizzy bg palette]]
[[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|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:
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 its 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|center|AGS palette after importing Dizzy background]]
[[Image:8bittut_dizzpala.png|center|AGS palette after importing Dizzy background]]
Line 107: Line 110:
[[Image:8bittut_discogam.png|center|Disco room screenshot]]
[[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.


==Conclusion==
==Conclusion==
Line 117: Line 120:




Coming next - [[256 Colour Tutorial Part 2|Part 2: Palette effects using pre-defined functions]]
Coming next - [[256 Colour Tutorial Part 2(V2.62)|Part 2: Palette effects using pre-defined functions]]
 
==Downloadable files used in this part==
*[[media:8bittut_basepal.pcx|PCX image - default AGS palette]]
*[[media:8bittut_ss0.pcx|PCX image - the Girl sprite]]
*[[media:8bittut_ss1.pcx|PCX image - the Girl and the Alien sprites]]
*[[media:8bittut_dizzy.pcx|PCX image - "Dizzy" background]]
*[[media:8bittut_disco.pcx|PCX image - "Disco" background]]
*[[media:8bittut_door.pcx|PCX image - Door sprite]]
*[[media:8bittut_paltut1.zip|ZIP file - part 1 stuff]]


(Return to [[Using 256 colour graphics in AGS]])
(Return to [[Using 256 colour graphics in AGS]])
[[Category:Intermediate Tutorials:Graphics Related:256 colour]]
[[Category:Intermediate Tutorials:Graphics Related:256 colour]]

Navigation menu