CodeBase - Create with image, position, Size, and show/hide sprite with one function

Return to the CodeBase listing

Category: Sprite

Version: 1.1



Uploaded: 29th Oct 2003 22:49

Modified: 3rd Nov 2003 17:06

Author:  orv


handy way to shorten your sprite making code and remove a few programming headaches.

Full Description

if you use sprites for buttons, etc., this can make your life a whole lot easier! <br /> one line and there is your button! and it will look the same no matter the screen rez.<br /> <br /> params:<br /> image# - image number which sprite will use <br /> X - X position to place sprite<br /> Y - Y position to place sprite<br /> width - width you want sprite to be<br /> height - height you want sprit to be<br /> bHide - boolean to determine if you want to hide the sprite right away<br /> <br /> * function assumes coords/width/heights put in are for 800x600 rez.<br /> * function automatically scales sprite and positions it properly for the actual rez currently set when routine is called.<br /> * if X is -1, it centers sprite on screen on the X axis.<br /> * if Y is -1, it centers sprite on screen on the Y axis.<br /> * if Width = 0, it will use the width of the sprite's image.<br /> * if Height = 0, it will use the height of the sprite's image.<br /> * if bHide = TRUE, it will hide the sprite.<br /> * function assigns and returns a sprite#.<br /> * the variable: nSpriteCounter must be a global integer.<br />


No comments yet.