View previous topic :: View next topic |
Author |
Message |
Jesuszilla Newbie cheater Reputation: 0
Joined: 29 Jul 2015 Posts: 11
|
Posted: Sun Feb 05, 2017 9:31 pm Post subject: Drawing rectangles using the Direct3DHook? |
|
|
So I recently found out about the Direct3DHook and its functions, but I only see things about loading from files.
I currently use a form and the canvas to draw hitboxes (would show a screen but I don't have enough posts to post URL's)
So I was wondering, is there a way to draw rectangles in Direct3D? Perhaps even convert a rectangle in the canvas to a texture to be used for a sprite?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Mon Feb 06, 2017 6:45 am Post subject: |
|
|
you can load from canvas, by assigning the rasterimage inherited class to a picture, and making a texture out of that picture, but there is currently no support for tranparent data in canvases so in the end it will look like a square with a rectange
only way right now for a rectangle is using some graphics software and make a transparent png with the rectange and load that (can be embedded inside the table so no need for seperate files)
if you mean acfual 3d triangles (e. g based on a vertexlist, then no, not currently implemented, but tbe d3dhook dll exports are easily hookable so you can always add an extension dll of yoir own)
_________________
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 |
|
|
Jesuszilla Newbie cheater Reputation: 0
Joined: 29 Jul 2015 Posts: 11
|
Posted: Mon Feb 06, 2017 10:28 am Post subject: |
|
|
Well I got something working by converting the canvas to a picture like you said, with transparency, too (just had to set the mask color to 0)! Only problem is the sprite I draw with the hitboxes doesn't change size from the original set of hitboxes I draw, meaning longer and taller ones get cut off. They also keep overlaying and creating a big mess on the screen.
Is there any way to clear what's been drawn by the D3D hook?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Mon Feb 06, 2017 10:39 am Post subject: |
|
|
sprites are not draw commands. They are object. So don't create sprites each time you draw, reuse them by assigning a new texture to them, or destroy when done with them
the z-order of the sprite determines if it'll be rendered on top of another sprite or not
to clear, destroy the spites or set them to invisible
_________________
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 |
|
|
Jesuszilla Newbie cheater Reputation: 0
Joined: 29 Jul 2015 Posts: 11
|
Posted: Mon Feb 06, 2017 10:52 am Post subject: |
|
|
Thanks! I'll try this when I get home! I'll probably end up just replacing the sprite since that seems most efficient.
But since I'll probably need to do this sometime in the future, and forgive me for asking if this is basic Lua, but what is the destructor method called for these objects? I don't recall seeing it in the documentation; is it obj.destroy() or object.dispose(), etc.?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Mon Feb 06, 2017 11:11 am Post subject: |
|
|
obj.destroy()
_________________
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 |
|
|
|