Results 1 to 7 of 7
  1. #1
    merp.'s Avatar
    Join Date
    Aug 2012
    Gender
    male
    Posts
    147
    Reputation
    10
    Thanks
    301
    My Mood
    Bored

    Automatically getting the X coordinates of a screen?

    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!)

  2. #2
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    Code:
    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);
    Not that hard
    Last edited by Ch40zz-C0d3r; 01-06-2013 at 08: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
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

  3. The Following 2 Users Say Thank You to Ch40zz-C0d3r For This Useful Post:

    [MPGH]Flengo (01-06-2013),merp. (01-06-2013)

  4. #3
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Ontario, Canada
    Posts
    15,691
    Reputation
    3319
    Thanks
    11,104
    My Mood
    Happy
    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's
    If you need help with anything, just let me know.
     
     
    VM | PM

    Publicist Since 04.04.2015
    Middleman Since Unknown - Unknown
    Global Moderator Since 08.01.2013
    Donator Since 05.29.2013

    Minion+ Since 04.18.2013

    District 187 Minion Since 04.04.2013
    Steam Minion Since 02.26.2013
    WarRock Minion Since 02.19.2013
    A.V.A Minion Since 02.13.2013
    DayZ Minion Since 01.21.2013
    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  5. #4
    cobi45's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    THE United States of America
    Posts
    101
    Reputation
    10
    Thanks
    61
    My Mood
    Breezy
    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 04:01 PM.

  6. #5
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    Quote Originally Posted by cobi45 View Post
    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.
    Same method which Im using

    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
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

  7. #6
    cobi45's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    THE United States of America
    Posts
    101
    Reputation
    10
    Thanks
    61
    My Mood
    Breezy
    or cursor center?

    #define ADDR_CURSORCENTER 0x00805D2C //Found at: 0x00505D23 ( Engine.exe[0x00460000] + 0x000A5D23 )

    Or am I thinking of a completely wrong thing here?

  8. #7
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    Quote Originally Posted by cobi45 View Post
    or cursor center?

    #define ADDR_CURSORCENTER 0x00805D2C //Found at: 0x00505D23 ( Engine.exe[0x00460000] + 0x000A5D23 )

    Or am I thinking of a completely wrong thing here?
    This address is a byte or boolean (1byte of size)
    If its 1, cursor is locked in middle of screen, else its free moveable

    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
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

Similar Threads

  1. [Need Help]Get the screen resolution
    By larta in forum WarRock Hack Source Code
    Replies: 6
    Last Post: 11-30-2010, 01:34 PM
  2. When i start CA with edited .REZ i get the blue screen of death
    By geewizzer1 in forum Combat Arms Mod Discussion
    Replies: 2
    Last Post: 11-29-2009, 02:32 AM
  3. were can i get the patch ?
    By ballin22 in forum WarRock Korea Hacks
    Replies: 13
    Last Post: 05-12-2007, 11:32 PM
  4. [help]how would i get the superjump address?
    By fable741 in forum WarRock - International Hacks
    Replies: 9
    Last Post: 05-08-2007, 09:37 AM
  5. Can i get the steam account gen???
    By domin8666 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 04-28-2007, 08:45 AM