Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
»
BGRABitmap and LazPaint
»
How to Animate Sprites in a Virtual Screen
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to Animate Sprites in a Virtual Screen (Read 2072 times)
JasonLugg
Jr. Member
Posts: 67
How to Animate Sprites in a Virtual Screen
«
on:
April 15, 2018, 06:15:29 pm »
Hi All,
Thanks in advance!
I am able to animate an IBGLTexture, however want to have the ViertScreens sprites animating. I set the texture (Frame Size & Frame Index) the same way but no animation is shown?
Code: Pascal
[Select]
[+]
[-]
AniImg
:
=
TBGLBitmap
.
Create
(
'PolyRoundCross.png'
)
;
AniImg
.
Texture
.
SetFrameSize
(
64
,
64
)
;
AniImg
.
Texture
.
SetFrame
(
1
)
;
AniSpr
:
=
TBGLSprite
.
Create
(
AniImg
.
Texture
,
0
)
;
AniSpr
.
X
:
=
150
;
AniSpr
.
Y
:
=
250
;
AniSpr
.
W
:
=
64
;
AniSpr
.
H
:
=
64
;
BGLVirtualScreen1
.
Sprites
.
Add
(
AniSpr
)
;
Then in Screen Redraw:
Code: Pascal
[Select]
[+]
[-]
BGLVirtualScreen1
.
Sprites
.
OnDraw
;
No sprite is displayed? Any ideas?
Logged
circular
Hero Member
Posts: 4471
Re: How to Animate Sprites in a Virtual Screen
«
Reply #1 on:
April 17, 2018, 12:49:03 pm »
Hi. You need to store the Texture in an IBGLTexture variable. Indeed the IBGLTexture interface is not guaranteed to exist continuously unless it is referenced somehow.
Logged
Conscience is the debugger of the mind
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
»
BGRABitmap and LazPaint
»
How to Animate Sprites in a Virtual Screen
TinyPortal
© 2005-2018