GetSpriteAlphaLevel
AlphaLevel# = GetSpriteAlphaLevel(SpriteIndex)
 
Parameters:

    SpriteIndex = The index of the sprite you wish to query
Returns:

    AlphaLevel# = The Alpha Blending level for this sprite.
 

      The GetSpriteAlphaLevel function returns the current Alpha Blending level from this sprite.



FACTS:


      * Also See SpriteAlphaLevel




Mini Tutorial:


      This example creates a blank FX image, creates a new sprite, sets the sprite to alpha blend mode with a Alpha Blend Level of %50 (0.5). It then displays the sprite and the blend level.

  
  
; Clear the Screen to a light blue colour
  Cls RGB(0,100,200)
  
  
; Create an blank Image. The pixels in the image will be black)
  MyImage=NewFXImage(300,200)
  
  
; Create Sprite
  MySprite=NewSprite(300,200,MyImage)
  
; Activate Alpha Blending as the Sprites draw mode
  SpriteDrawMode MySprite, 4
  
; Turn off transparent mode in the sprite
  SpriteTransparent mySprite, off
  
  
; Set this sprite to Alpha Blending Level 0.5 (50%)
  SpriteAlphaLevel MySprite,0.5
  
; Display the current Alpha Blending Level
  Print "Blend Level:"+Str$(GetSpriteAlphaLevel(MySprite))
  
; draw the sprite to the screen
  DrawSprite MySprite
  
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  


This example would output.

  
  Blend Level:0.5
  

 
Related Info: SpriteAlphaColour | SpriteAlphaLevel | SpriteDrawMode :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com