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 


How do I just show text via D3D?

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

Joined: 23 Sep 2020
Posts: 26

PostPosted: Fri Sep 25, 2020 12:48 am    Post subject: How do I just show text via D3D? Reply with quote

Ive been playing with the code from:
forum.cheatengine.org/viewtopic.php?t=552281

I modified it to display what I want (in a timer), but I just want text to display my coordinates. I dont need a menu or options or even a background really.

I dont know how to make it not show the background from that post.

This is what I got thus far which is just my putting in "yourxalue".
It does show my text, but the background is garbage and the text is odd..

Everytime I change anything for the background stuff I get errors.

So how do I get rid of the background and just show my text?

Code:


strings_add(getAutoAttachList(), "MyGame.exe")


background=createPicture()
bmp=picture_getBitmap(background);

graphic_setHeight(bmp,1)
graphic_setWidth(bmp,1)
c=rasterimage_getCanvas(bmp)

canvas_setPixel(c,0,0,0xff0000)

highlighter=createPicture()
bmp=picture_getBitmap(highlighter);

graphic_setHeight(bmp,1)
graphic_setWidth(bmp,1)
c=rasterimage_getCanvas(bmp)

canvas_setPixel(c,0,0,0x0000ff)



d3dhook_initializeHook()

bgtexture=d3dhook_createTexture(background)

bgsprite=d3dhook_createSprite(bgtexture);
d3dhook_renderobject_setX(bgsprite, -1) --center it horizontally
d3dhook_sprite_setWidth(bgsprite,200)
d3dhook_sprite_setHeight(bgsprite,200)

highlightertexture=d3dhook_createTexture(highlighter)
hlsprite=d3dhook_createSprite(highlightertexture)
d3dhook_renderobject_setVisible(hlsprite, false) --don't show it just yet
d3dhook_renderobject_setX(hlsprite, -1) --center (so matches with the background)
d3dhook_sprite_setWidth(hlsprite,200)



font=createFont()
fontmap=d3dhook_createFontmap(font)

lineheight=d3dhook_texture_getHeight(fontmap) --fontmap inherits from texture so this can be used

d3dhook_sprite_setHeight(hlsprite,lineheight) --make the highlightr the same height as a textline

Option1=d3dhook_createTextContainer(fontmap,-1,50, yourxvalue)
Option2=d3dhook_createTextContainer(fontmap,-1,50+lineheight, youryvalue)
Option3=d3dhook_createTextContainer(fontmap,-1,50+lineheight*2, yourzvalue)


function setHighlighterToSelectedOption()
  d3dhook_renderobject_setY(hlsprite, 50+lineheight*(selectedOption-1))
end


--setHighlighterToSelectedOption()
d3dhook_renderobject_setVisible(hlsprite, true)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Sep 25, 2020 3:24 am    Post subject: Reply with quote

remove
Code:

bgtexture=d3dhook_createTexture(background)
bgsprite=d3dhook_createSprite(bgtexture);

_________________
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
pursuited357
Cheater
Reputation: 0

Joined: 23 Sep 2020
Posts: 26

PostPosted: Fri Sep 25, 2020 5:58 am    Post subject: Reply with quote

Ok that worked...

Now I modified it to display my coords properly, but if I put it in a timer to keep it displaying the text keeps overlapping.

So how do I erase the previous text so that during the time it keeps showing the coords? Instead of constantly putting the text over each other.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Sep 25, 2020 6:09 am    Post subject: Reply with quote

textContainerObject.Text=newtext
_________________
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
pursuited357
Cheater
Reputation: 0

Joined: 23 Sep 2020
Posts: 26

PostPosted: Sun Sep 27, 2020 12:18 am    Post subject: Reply with quote

Hey thx again DB, as usual worked again!
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