Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


D3D clearing drawn text

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
JohnDude
Newbie cheater
Reputation: 0

Joined: 30 Aug 2013
Posts: 20

PostPosted: Sat Jul 05, 2014 4:17 pm    Post subject: D3D clearing drawn text Reply with quote

Hi. I have one question about the example below


Whenever I use 'd3dhook_textcontainer_setText' it overwrites previous one.Would you tell me guys how to clear Old Drawn Text before updating it.Thanks in advance



Code:
d3dhook_initializeHook()

font=createFont() --Default initialized to the mainform font. (black and small)
--You can change the font properties like size, type, bold, color, etc.. (Don't do italic as it can break the fontmap)

fontmap=d3dhook_createFontmap(font)  --create a fontmap from the defined font. After this font can be destroyed. If you wish different colors and types, create a new fontmap each time


DisplayedTextObject=d3dhook_createTextContainer(fontmap,100,100,'LOLOLOLOLOLOLOLOL')

--The DisplayedTextObject is a TextContainer class. It inherits from the D3DHook_RenderObject, so d3dhook_renderobject_* methods work on this object
--example to change the y position to 300 you'd do
d3dhook_renderobject_setY(DisplayedTextObject, 300)

--The textcontainer also has it's own methods, like d3dhook_textcontainer_setText
d3dhook_textcontainer_setText(DisplayedTextObject, "Updated Text")
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sat Jul 05, 2014 4:27 pm    Post subject: Reply with quote

are you sure you're using setText on the old textcontainer object ?
Because what you're describing is that you're making a new textcontainer at the same spot (e.g executing that script a second time will create a second text container)

But if you don't and it's a bug (e.g the stringlength isn't reset for some reason) then fill in spaces first
e.g.
Code:

DisplayedTextObject.Text="                                    "

and then afterwards set the text
Code:

DisplayedTextObject.Text="Updated Text"

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
JohnDude
Newbie cheater
Reputation: 0

Joined: 30 Aug 2013
Posts: 20

PostPosted: Sat Jul 05, 2014 4:46 pm    Post subject: Reply with quote

EDIT:

thanks for help.

yeah I set textcontainer at the same spot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites