View previous topic :: View next topic |
Author |
Message |
Filipe_Br Master Cheater Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Mon Jun 26, 2017 10:24 am Post subject: D3DHook - How to draw lines on the screen? |
|
|
I want to draw lines on the screen of a game, but I do not want this black background square.
Code: | d3d = createD3DHook()
pic = createPicture()
pic.Bitmap.Width = 100
pic.Bitmap.Height = 100
pic.Bitmap.Canvas.Pen.Color = 0xFF
pic.Bitmap.Canvas.line(0, 0, 50, 50)
texture = d3d.createTexture(pic)
sprite = d3d.createSprite(texture)
sprite.X = 0
sprite.Y = 0 |
Description: |
|
Filesize: |
9.37 KB |
Viewed: |
11144 Time(s) |
|
_________________
... |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Mon Jun 26, 2017 11:36 am Post subject: |
|
|
try using a transparent PNG
or use createTexture(picture, transparentColor OPTIONAL)
where transparentColor is black (need 6.7 as 6.6 is bugged)
_________________
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 |
|
|
Filipe_Br Master Cheater Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Mon Jun 26, 2017 11:53 am Post subject: |
|
|
I was using CE 6.4, with CE 6.7 I managed to solve this problem, but there appears another with the "textContainer".
Code: | d3d = createD3DHook()
font = createFont()
fontmap = d3d.createFontmap(font)
textContainer = d3d.createTextContainer(fontmap, 0, 0, "HELP") |
Description: |
|
Filesize: |
4.45 KB |
Viewed: |
11129 Time(s) |
|
_________________
... |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Mon Jun 26, 2017 12:02 pm Post subject: |
|
|
textcontainer is always annoying.
Anyhow, this looks like the position is on a half pixel. Try increasing the x position by 0.5
you may wish to turn anti-aliasing of the font off as well
_________________
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 |
|
|
Filipe_Br Master Cheater Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Mon Jun 26, 2017 12:57 pm Post subject: |
|
|
Thanks for the help, problems solved.
[Script fix font]
Code: | d3d = createD3DHook()
font = createFont()
font.Quality = 'fqNonAntialiased'
fontmap = d3d.createFontmap(font)
textcontainer = d3d.createTextContainer(fontmap, 0, 0, "HELP") |
_________________
... |
|
Back to top |
|
|
mindoff Advanced Cheater Reputation: 0
Joined: 12 Jun 2016 Posts: 96
|
Posted: Sun Jul 09, 2017 10:18 pm Post subject: |
|
|
Hey,glad to find this post.
I have a question.CE have D3DHook,what about opengl?
I tried some OGL game,it won't work.
Is there any OGLHook to do the same thing?
And the font only works for ANSI.If I use some UTF-8 character,It won't display.
Any idea to print UTF-8 character on screen?Thanks.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Sun Jul 09, 2017 10:52 pm Post subject: |
|
|
no opengl hook yet
create a bitmap.
use canvas.textOut() to draw a string into that bitmap and then render that bitmap as a sprite.
when you update the text just repaint the bitmap with the new text and then update the texture of the sprite
_________________
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 |
|
|
|