GetSpriteFilter
Mode = GetSpriteFilter(ThisSprite)
 
Parameters:

    ThisSprite = The Sprite that you want to query
Returns:

    Mode = Flag to set filtering mode the sprite should use (0=No filtering default, 1 = Bilinear)
 

      The GetSpriteFilter is used to retrieve what filtering mode a sprite is using.


FACTS:


      * Sprite filtering is disabled (set to 0) by default.

      * When a filtered sprite is drawn, each pixel from the sprite image is blended with it's neighboring pixels. This blending calculation is heavy (on your CPU) to performs in real time, so it's best used sparingly. Pre-calculation is recommended.

      * See SpriteDrawMode for more effects that can be combined with sprite filtering.


 
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
     
     X=Rnd(GetScreenWidth())
     y=Rnd(GetScreenHeight())
     
   ; Create a sprite
     Spr=NewSprite(X,y,BubbleImage)
     
     PositionSpriteZ Spr,50
     
   ; Center this sprites handle
     CenterSpriteHandle Spr
     
   ; Set The sprite to Rotated draw mode
     SpriteDrawMode Spr, 2
     
   ; Scale the sprite to double it's images size
     ScaleSprite Spr,2
     
   ; Set this sprites filter mode to 1 (bi-bilinear filtering)
     SpriteFilter Spr, Rnd(1)
     
  Next
  
  
; limit the program to a max of 60 frames per second
  SetFPS 60
  
  
  Camera=NewCamera()
  
  Do
     
     CaptureToScene
     ClsScene
     
   ; Turn the sprites
     Sprite=GetFirstSprite()
     While Sprite
        
        x=GetSpriteX(Sprite)
        y=GetSpriteY(Sprite)
        
      ; Turn This sprite
        TurnSprite Sprite,0.5
        
        CenterText x,y,"FilterState:"+Str$(GetSpriteFilter(Sprite))
        
      ; Get the NExt Sprite
        Sprite=GetNextSprite(Sprite)
     EndWhile
     
     
   ; Capture the sprites to the scene buffer for camera render
     DrawAllSprites
     
     
   ; draw the screen to the backbuffer
     DrawCamera Camera
     
   ; Show the screen
     Sync
     
   ; Loop back to the Do statement to keep program running
  Loop
  
  
  
  
  
 
Related Info: GetSpriteTint | SpriteDrawMode | SpriteFilter | SpriteTint :
 


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