Sprite Size

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Sprite Size

Post by Dr. Dri »

Code: Select all

Structure PB_Sprite
  Sprite.l      ; DirectDrawSurface7 pointer
  Width.w       ; Current width of the sprite (could change if ClipSprite() is used)
  Height.w      ; Current height of the sprite (could change if ClipSprite() is used)
  Depth.w       ; Sprite depth
  Mode.w        ; Sprite mode, as descripted in LoadSprite()
  FileName.l    ; Pointer on the filename, if any
  RealWidth.w   ; Original width of the sprite when it was loaded
  RealHeight.w  ; Original height of the sprite when it was loaded
  ClipX.w       ; X offset if ClipSprite()
  ClipY.w       ; Y offset if ClipSprite()
EndStructure
It may be very usefull with clipped sprites to know the sprite real width and height... So when i saw that you have size and real size in the same structure i thought it wouldn't be too hard to add those two functions...

Code: Select all

SpriteRealWidth(#Sprite)
SpriteRealHeight(#Sprite)
Dri :idea:

Ca pourrais etre utile avec les sprites "clippés" de connaitre la taille réelle du sprite... Donc quand jme suis rendu compte qu'on trouvais ces infos dans la même structure jme suis dit que ce serais pas trop dur d'ajouter ces deux fonctions à PB...