Not that hardCode:D3DVIEWPORT9 Viewport; pDevice->GetViewport(&Viewport); DWORD ScreenX = Viewport.Width / 2; DWORD ScreenY = Viewport.Height / 2; A.scale_x = ScreenX / bmap_width(A.bmap); A.scale_y = ScreenY / bmap_height(A.bmap);
As the title states, how would I be able to get the X coordinates of a screen? (When it resizes?)
Ex: when I am at the login screen, my Screensize is 1366x768 (Black bars at both sides, so my screen is affected).
but when I am in game, my screensize goes back to my default, 1600x900. I would like to be able to get the X coordinate when the screen resizes so that I when I a draw a box using DrawBox, it'll stay in the same place.
ex1:
DrawBox(400, 20);// just the x + y coords. (random coords)
If I were to draw this box in 1366 x768 size, it would be where I want it.
However, if I were to use this once again in 1600 x900 size, the box would be in the wrong place.
How would I be able to get the X coordinates automatically, so that if the screen resizes, it would be in the same place, no matter what?
I got the width of the box to automatically fit the size using the cScreenInfo class @Flengo uploaded. (Thank you!)
Not that hardCode:D3DVIEWPORT9 Viewport; pDevice->GetViewport(&Viewport); DWORD ScreenX = Viewport.Width / 2; DWORD ScreenY = Viewport.Height / 2; A.scale_x = ScreenX / bmap_width(A.bmap); A.scale_y = ScreenY / bmap_height(A.bmap);
Last edited by Ch40zz-C0d3r; 01-06-2013 at 07:07 AM.
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
[MPGH]Flengo (01-06-2013),merp. (01-06-2013)
My example for ReClass wasn't really something "useful" to be used. The method posted above is actually what I use to get screen resolution.
My tutorial was just an example to get used to ReClass.
I Read All Of My PM's & VM'sIf you need help with anything, just let me know.
Staff Administrator Since 10.13.2019
Publicist Since 04.04.2015
Middleman Since 04.14.2014
Global Moderator Since 08.01.2013
Premium Since 05.29.2013
Minion+ Since 04.18.2013
Combat Arms Minion Since 12.26.2012
Contributor Since 11.16.2012
Member Since 05.11.2010
I have my X-hairs calibrating from the screen resizing, I'm not exactly sure how I did it >.< it was like from 2 years ago and I haven't touched it since.
Last edited by cobi45; 01-06-2013 at 03:01 PM.
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
or cursor center?
#define ADDR_CURSORCENTER 0x00805D2C //Found at: 0x00505D23 ( Engine.exe[0x00460000] + 0x000A5D23 )
Or am I thinking of a completely wrong thing here?
Progress with my game - "Disbanded"
- Fixed FPS lag on spawning entities due to the ent_preload buffer!
- Edit the AI code to get some better pathfinding
- Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
- Added a new silencer for ALL weapons. Also fixed the rotation bugs
- Added a ton of new weapons and the choice to choose a silencer for every weapon
- Created a simple AntiCheat, noobs will cry like hell xD
- The name will be Disbanded, the alpha starts on the 18th august 2014
Some new physics fun (Serversided, works on every client)
My new AI
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k