Afterwarp Development  

Go Back   Afterwarp Development > Software/Game Development > Programming and Graphics
Programming and Graphics Discuss any issues related to programming using Borland Delphi and computer graphics.


 
 
Thread Tools Display Modes
  (#1) Old
Bono Bono is offline
Dedicated
Bono is on a distinguished road
 
Posts: 24
Join Date: Nov 2006
Location: France
Fonts with sprites... - 23-Sep-2011, 05:35

I try to put a text over my sprites like this:

Code:
procedure TPnj.DoMove(const MoveCount: Single);
begin
  ...
  if TexttoDraw=True then
   begin
    Fonts[0].TextOut( Point2(x,y),Name,cColor2($FFFFE887, $FFFF0000), 1.0);
   end;
  ...
No problem when fonts are less than client screen but when x or y>client screen nothing appear.

Any way to synchronize fonts with sprites ?
Something like : Fonts[0]:=TAsphyreFonts.Create(SpriteEngine);

(Edit):I try this and now it works!

Code:
  if TexttoDraw=True then
   begin
    scrx:=x-engine.WorldX;
    scry:=y-engine.WorldY;
    Fonts[0].TextOut( Point2(scrx,scry),Name,cColor2($FFFFE887, $FFFF0000), 1.0);
   end;

Last edited by Bono; 23-Sep-2011 at 18:47. Reason: I found a solution...
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aphyre Sprites Ini Loader Lord_Evil Published Resources 0 11-Dec-2008 22:21
Sprite Engine - Tagged Sprites hmelihkara Technical Support 3 20-Jul-2008 19:23
Sprite engine improvement: "pinned" sprites masonwheeler Published Resources 1 09-Feb-2008 16:08
Overal performance when drawing sprites. Wodzu Development 4 09-Feb-2007 10:21
Problem with Fonts loading Ostap Technical Support 4 24-Nov-2005 14:40



vBulletin® is copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com
Copyright (c) 2000 - 2016 Afterwarp Development. All rights reserved.