When you were choosing the graphics for the object earlier in this tutorial,
you probably noticed that most of the graphics available didn't look up to
much. This is no problem, because you can import your own graphics using
the Sprite Manager.
Go to the Sprites pane in the editor. Here, you will see
the complete sprite set for the game. There are two ways to import your
graphics - either overwrite an existing slot with your graphic, or
create a new slot for it.
To overwrite an existing sprite, right-click the sprite and select "Replace sprite
from file". To import a new slot, right-click on the background to the window
and choose "Import new sprite".
The graphic you choose to import must be at the same colour depth as your game
(ie. if you are using hi-colour backgrounds, your sprites must be hi-colour,
and vice versa). AGS will attempt to convert the image if possible, but if
your game is 256-colour then the results of downgrading a hi-colour image
can be poor.
Then, the Import Sprite window will appear. Here, you need to decide which portion
of the image will be imported. You do this by right-clicking and dragging in the
image, which will produce a yellow rectangle showing the selection. Once you are
happy with it, left-click to import.
Alternatively, you can import the entire image with the "Import whole image" button.
NOTE (256-colour only):
You may well find that the colours on your graphic look slightly strange in
the AGS Editor. This is because the sprites are only allocated, by default,
the first 41 of the palette colours (see the palette section), so
your graphic will be remapped to this much smaller palette. If you find that
many of your imported sprites look strange, you can increase the number of
colours assigned to sprites, at the expense of background colours (again see
the section above for information on how to do this).
If your sprite will only be used in one room then alternatively you can
use the "use background palette" option, which will remap your graphic to
the palette of the room currently loaded, giving much better results. Note,
however, that if you do this, and then try and use the sprite on another
screen, its colours will most likely be screwed up. To use the room palette,
check the "use bkgrnd pal" check-box. Make sure to un-check this box before
you import any other sprites.
NOTE: The transparent colour used by AGS is palette index 0 (for 256-colour
sprites) and RGB (255,0,255) for hi-color. Any pixels you draw on imported
sprites in these colours will be transparent.
You can group imported sprites into folders. This prevents the main sprite
list from becoming too long. By default, the Sprite Manager displays the
Main folder, which contains some graphics and a sub-folder called "Defaults".
Folders work the same way as Windows folders. Right-click on a folder in the
tree to rename it or make a sub-folder.
You can delete a folder by right-clicking on it and selecting the "Delete"
option; beware though that this will also delete all the sprites in the folder.
* NOTE: A few people have experienced problems when importing from clipboard,
in that the image colours get reversed (red becomes blue, blue becomes red, and so on)
when they are running Windows at 24-bit or 32-bit colour. If this happens to you, there
are two solutions: (a) turn down your desktop colour depth to 16-bit to run the AGS Editor,
or (b) import your sprites from files rather than the clipboard.
Tiled sprite import
You may have noticed a checkbox called "Tiled sprite import". Some people find
this a useful way of importing many frames of a character's animation at once.
In order for this to work, you need to have all your sprites lined up on your
source bitmap at even intervals. Then, use the "Import from file" option and import it
as usual. Check the "Tiled sprite import" box, and select the upper-left frame.
When you click the left mouse button, the selection rectangle will become un-filled
and now you can drag the mouse to define how many frames to import - they'll all
be enclosed by selection rectangles. Once you have the correct number, click the left
button again and they will all be imported.
Alpha blended sprites
AGS supports alpha blended sprites if your game is 32-bit colour. In this case, you
need to import a PNG image with an alpha channel (you cannot paste alpha-blended
images from the clipboard).
When you do so, AGS will prompt you asking whether you want to use the image's alpha
channel or not. If you select Yes, then the sprite will be drawn alpha blended in
the game if it is used for a character, object, mouse cursor or GUI.
Note that if you use alpha blending, any overall transparency that you set (such
as Character.Transparency, Object.Transparency, GUI.Transparency) will be ignored.
NOTE: Currently, alpha blended sprites cannot be antialiased, so if you have
the Anti Alias Sprites option turned on in Setup, it will not be applied to alpha-blended
characters.
|