Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1403631 Posts in 68266 Topics- by 61926 Members - Latest Member: Uchida

November 26, 2022, 04:27:50 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Replace background color by area and by color with directdraw API
Pages: [1]
Print
Author Topic: Replace background color by area and by color with directdraw API  (Read 1302 times)
marco999
Level 0
*


View Profile
« on: June 04, 2022, 06:52:09 AM »

Hi,

I need to implement a sort of "select box" on this vertical menu:

http://pro-software.it/bzbackground2.png

In short I like to add the possibility to navigate the vertical menu via arrow keys.

I have already hook the game (that is a old 32 bit), but this part I need to do manually.

I thing the best way is use directdraw API but I don't have experience about it.

Theoretically I can follow 2 ways:

1) Change and resume the backgroud color of the selected item by position and color.
2) Add and remove a rounded box outside the selected item by position (this is not best but seem more easy to do).

I ask what are the directdraw (or other) API that do it.

Any tips are much appreciated.

Best Regards
Logged
michaelplzno
Level 10
*****



View Profile WWW
« Reply #1 on: June 04, 2022, 01:54:59 PM »

Not sure what you are trying to do from this post, you want to render a highlighted version of the menu buttons? Can't you just change the bg image that is being rendered already to a different art asset?
Logged

marco999
Level 0
*


View Profile
« Reply #2 on: June 05, 2022, 04:11:01 AM »

Not sure what you are trying to do from this post, you want to render a highlighted version of the menu buttons? Can't you just change the bg image that is being rendered already to a different art asset?

HI Michael,

Thank you for your response:)

Not sure what you are trying to do from this post, you want to render a highlighted version of the menu buttons ?
- Yes, it is true.

Can't you just change the bg image that is being rendered already to a different art asset?
- Inside the image there is the text and the menu is dynamic. I don't sure it is the best way.

I have already hooked the game with detours, so while I don't have the source code I can manipulate it externally with my code (in this case with directdraw and intercept the window handle).

In short, the vertical menu is accessible only with numeric keys, but I like to navigate it with arrow keys.
To do it I need the change the backgound color of the selected item (that actually not exist becouse is accessible directly with numeric keys ), but when the selected item is changed, the backgound color of the previous item must be resumed.

To do it I think (but not sure) that I need 2 functions:

1) Change the backgound color (that accept in input: the x,y coordinates in pixel, the target color, the new color to replace)
2) Resume the previous background color (undo the previous draw operation).

I don't have experience with directdraw, but I suppose the first thing to do is find the current window handle (hwnd) that it is easy to do.
  
After I don't know how is possible replace the color and what API must be use.

Can you help me please ?

Best Regards






« Last Edit: June 05, 2022, 05:53:18 AM by marco999 » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic