Archived

This topic is now archived and is closed to further replies.

Write Text on Sprite

This topic is 5003 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have balloons on screen (TBalloon), each balloon carry a number on it, so I put a private number:integer in it and in its DoMove i use this procedure TBalloon.DoMove(MoveCount:integer); begin Engine.Surface.Canvas.TextOut(Trunc(X),Trunc(Y),''Test''); end; it display the text once and then pause, so I add procedure TBalloon.DoMove(MoveCount:integer); begin Engine.Surface.Canvas.TextOut(Trunc(X),Trunc(Y),''Test''); Engine.Surface.Canvas.Release; end; There''s nothing happen! So why?

Share this post


Link to post
Share on other sites
I don''t know the TBalloon or what Engine you use, but if you get text out, then you are hitting the correct canvas.

The DoMove is presumably a method which shifts the Balloon object inside the Engine?

First, you don''t say how big the move is. If it is too small, then the trunc(X) (Y) won''t give changed coordinates.

Second, you may like to have it test-print the coordinates after a move.

Third, if X,Y are properties of the balloon and the Engine, you may need to be more specific and do trunc(balloon.X),trunc(Balloon.Y) so the Engine can distinguish which X,Y you mean.

If this doesn''t work, you may have to supply more information, or wait for somebody who knows the Objects you reference.



Stevie

Don''t follow me, I''m lost.

Share this post


Link to post
Share on other sites
The main problem is not the X,Y of the object, even I used
Engine.Surface.Canvas.Textout(0,0,''Test''); the problem still remain
The engine is TSpriteEngine in DelphiX
The question is ''Is there anyway to display text on my sprite( each sprite display different text)?''

Share this post


Link to post
Share on other sites