GetSpriteTint |
ThisRGB = GetSpriteTint(ThisSprite) |
|
Parameters: ThisSprite = The Sprite that you want to change the diffuse colouring of
|
Returns:
ThisRGB = The RGB colour that the sprite will be tinted with. Default is Rgb(255,255,255) |
|
The GetSpriteTint function returns the sprites current Tint (diffuse) colour.
FACTS:
* Sprite default tint colour is RGB(255,255,255) (white).
* See SpriteDrawMode for more effects that can be combined with sprite tint.
|
|
Example Source: Download This Example ; Load Bubble Media which is located two folders back from ; this path. BubbleImage=LoadNewFxImage("..\../Media/bubble_64x64.bmp") ; Create a number of ranomdly positioned sprites For lp=1 To 10 ; Get a random coord on the screen X=Rnd(GetScreenWidth()) Y=Rnd(GetScreenHeight()) ; Create a sprite Spr=NewSprite(X,y,BubbleImage) ; Center this sprites handle CenterSpriteHandle Spr ; Set this sprites drawmode to rotated SpriteDrawMode Spr, 2 ; Set this sprites tint colour to some random colour SpriteTint Spr,RndRGB() Next ; limit the program to a max of 75 frames per second SetFPS 75 Do ; Clear the Screen Cls RGB(30,40,70) ; Get the Mouse Pointers Position mX=MouseX() mY=MouseY() ; Update the Sprites TurnSpeed#=1 Sprite=GetFirstSprite() While Sprite ; Turn This sprite TurnSprite Sprite,TurnSpeed# ; Bump The Turn Speed TurnSpeed#=TurnSpeed#+0.10 DrawSprite Sprite Xpos=GetSpriteX(Sprite) Ypos=GetSpriteY(Sprite) TintColour=GetSpriteTint(Sprite) CenterText Xpos,ypos+30,Hex$(TintColour) ; Get the NExt Sprite Sprite=GetNextSprite(Sprite) EndWhile ; Show the screen Sync ; Loop back to the Do statement to keep program running Loop |
|