spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * DrawingSurface functions and properties

DrawImage

(Formerly known as RawDrawImage, which is now obsolete)
(Formerly known as RawDrawImageResized, which is now obsolete)
(Formerly known as RawDrawImageTransparent, which is now obsolete)

DrawingSurface.DrawImage(int x, int y, int slot, optional int transparency,
                         optional int width, optional int height)
Draws image SLOT from the sprite manager onto the surface at location (X,Y).

Optionally, you can also specify the transparency of the image. This is a number from 0-100; using a transparency of 50 will draw the image semi-transparent; using 0 means it will not be transparent.

You can also resize the image as you draw it. In order to do this, simply specify a width and height that you wish to resize the image to when it is drawn.

NOTE: This command only works if the image to be drawn is the same colour depth as the surface that you are drawing onto.

NOTE: Transparency does not work in 256-colour games, or with 256-colour sprites.

NOTE: The X and Y co-ordinates given are ROOM co-ordinates, not SCREEN co-ordinates. This means that in a scrolling room you can draw outside the current visible area.

Example:

DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawImage(100, 100, oDoor.Graphic, 40);
surface.Release();
will draw the oDoor object's graphic onto the room background at (100, 100), at 40% transparency.

See Also: DrawingSurface.DrawLine, DrawingSurface.DrawString, DrawingSurface.DrawSurface, Room.ColorDepth


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.