News:

FOR INFORMATION ON DONATIONS, AND HOW TO OBTAIN ACCESS TO THE GAME, PLEASE VIEW THE FOLLOWING TOPIC: http://stick-online.com/boards/index.php?topic=2.0

Main Menu

Stick Online HotKeyz - v1.03, Full Screen Support!

Started by Cactuscat222, February 24, 2010, 03:02:03 AM

Previous topic - Next topic

ARTgames

#30
edit: most of this is not right. my bad

Ok, crap! Your 100% right about the end. I have no idea what i was thinking on that last part. >_<

edit 3-3-2010
Ok, crap! Your 100% right about the end. I have no idea what i was thinking on that last part. >_< (agen! i keep getting it wrong)


Variables meanings:

click placement for windows x (the x the mouse clicks on your so hot keys in window mode) = x
click placement for windows Y (you get the idea) = y

width in pixels of user native screen rez he running his display at = screen_width
screen_height ( self explanatory )

start out as stick online's original window width, then we change it later = so_width
so_height ( self explanatory )

this will tell you the x of ware your mouse needs to click on the screen when in full screen = ware_to_click_x
ware_to_click_y ( self explanatory )



Script in pseudo code:


screen_width / screen_height = screen_aspect
so_width / so_height  = so_aspect

if screen_aspect > so_aspect {
  /* The users screen is wider then stick online's window, so the game will rez the window till its height fits the screen */

  so_height = screen_height
  so_width = so_height * so_aspect
}

if screen_aspect < so_aspect {
  /* if the screen is taller than so's*/

 so_width = screen_width
 so_height = so_width / so_aspect
  /* Note: "so_aspect" is stick online's original aspect ratio. 1.583 something according to lingus. */
}

if screen_aspect = so_aspect {

  so_width = screen_width
  so_height = screen_height
  /*simple eh */
}

/*(I took this part from lings post. He gets credit for it.)*/
ware_to_click_x = so_width / 950 * x
ware_to_click_y = so_height / 600 * y




Now its right. ( I hope ) Or really close.

Lingus

Not quite right yet (at least I don't think)

Take a look at my formula again:

QuotefullX = (originalX / originalSoWidth) x fullSoWidth

screenX = (fullX / fullSoWidth) x screenWidth
Notice, this is only for X. You need these 2 formulas to get the final placement of each coordinate.

I think what you're doing in your if statements, you're replacing a variable you will need later. So instead of doing this:
Quoteso_width = screen_width

It should be:
Quotefull_so_width = screen_width

Then you can keep that "so_width" for later use.

Here, I rewrote the pseudocode:

QuotescreenWidth / screenHeight = screenAspect
originalSoWidth / originalSoHeight  = soAspect

if screenAspect > soAspect {
   /* The users screen is wider then stick online's window, so the game will rez the window till its height fits the screen */

   fullSoHeight = screenHeight
   fullSoWidth = originalSoHeight * soAspect
}

if screenAspect < soAspect {
   /* if the screen is taller than so's*/

  fullSoWidth = screenWidth
  fullSoHeight = originalSoWidth / soAspect
   /* Note: "so_aspect" is stick online's original aspect ratio. 1.583 something according to lingus. */
}

if screenAspect = soAspect {

   fullSoWidth = screenWidth
   fullSoHeight = screenHeight
   /*simple eh */
}


fullX = (originalX / originalSoWidth) x fullSoWidth
screenX = (fullX / fullSoWidth) x screenWidth

fullY = (originalY / originalSoHeight) x fullSoHeight
screenY = (fullY / fullSoHeight) x screenHeight

Also, wrapped around the whole thing, you need to check if the actual game window screen size is larger than the established original size. So something like:

Quoteif currentSoWidth > originalSoWidth {
[code from above]
}

Cactuscat222

Haha, wow guys, thanks for doing this -.- I haven't had the time to try it yet, but I will shortly. I was working earlier on it, but you guys got farther than I did. I'll update soon too let you know if this works.


Check out Stick Online HotKeyz v1.03 (Now with Full Screen Support!): Click Here

Lingus

No problem. I have fun doing stuff like this. Having a problem and trying to figure it out with other people. Good stuff.

ARTgames

Ok i know i have done something wrong. My next post is not going out without me testing it.

ARTgames

#35
Quote

Also, wrapped around the whole thing, you need to check if the actual game window screen size is larger than the established original size. So something like:

Quoteif currentSoWidth > originalSoWidth {
[code from above]
}
what? whats the "established original size"?



ok i think all i really need to do is change this

so after my if's change:
ware_to_click_x = screen_width / so_width * x
ware_to_click_y = screen_height / so_height * y


to

ware_to_click_x = so_width / so_width_original * x
ware_to_click_y = so_height / so_height_original * y
so by "so_width_original" i mean stick onlines original window size. it does not even need to be a variable. it could just be a constant.

this would be better.

ware_to_click_x = so_width / 950  * x (do not forget x is the old place to click when so is in window mode)
ware_to_click_y = so_height / 600  * y

I forgot what i needed to do is compare so old size to the new one and your post told me that. ty ling. that was my bad!

i edit my post at top to reflect what i said in this post.
http://www.stick-online.com/boards/index.php?topic=786.msg21049#msg21049

Lingus

Quote from: ARTgames on March 03, 2010, 05:08:32 PM
Quote

Also, wrapped around the whole thing, you need to check if the actual game window screen size is larger than the established original size. So something like:

Quoteif currentSoWidth > originalSoWidth {
[code from above]
}
what? whats the "established original size"?

That's the 950x600. So if the game window size is 950x600, you don't want the code to do anything. If it does, then it will think the game size is the full screen size.

Quote from: ARTgames on March 03, 2010, 05:08:32 PM
ok i think all i really need to do is change this

so after my if's change:
ware_to_click_x = screen_width / so_width * x
ware_to_click_y = screen_height / so_height * y


to

ware_to_click_x = so_width / so_width_original * x
ware_to_click_y = so_height / so_height_original * y
so by "so_width_original" i mean stick onlines original window size. it does not even need to be a variable. it could just be a constant.

this would be better.

ware_to_click_x = so_width / 950  * x (do not forget x is the old place to click when so is in window mode)
ware_to_click_y = so_height / 600  * y

I forgot what i needed to do is compare so old size to the new one and your post told me that. ty ling. that was my bad!

i edit my post at top to reflect what i said in this post.
http://www.stick-online.com/boards/index.php?topic=786.msg21049#msg21049
I still think that's not quite right. Because there's a difference between what you're getting as the full screen game window size and the actual game window size. When you're in full screen, I assume the game window size is actually the entire screen, but where the game actually displays is smaller (hence the black bars). But the black bar area is still actually part of the game window.

As an example, if you take 1280x1024 monitor resolution. You use your formula to calculate the full screen game window size:
(Also, note the variable in red is where I found a mistake in the code from my previous post.)
QuotescreenWidth(1280) / screenHeight(1024) = screenAspect(1.25)
originalSoWidth(950) / originalSoHeight(600)  = soAspect(1.58)

if screenAspect(1.25) < soAspect(1.58) {

  fullSoWidth(1280) = screenWidth(1280)
  fullSoHeight(810) = screenWidth(1280) / soAspect(1.58)
}

So you have a game screen size of 1280x810 which is the same aspect ratio as the original game window size. What that does not account for is that the actual game window size is really 1280x1024, but a portion of that 1024 is black bar. That's where my two formulas are coming into play. It finds the coordinates if the game size were 1280x810, and then it finds the real coordinates based on the full screen size of 1280x1024.

ARTgames

#37
I see what your saying now. See i was trying to do that but i still did make a mistake.

  so_width = screen_width
  so_height = so_width / so_aspect


that is really worng! >_<

edit:
cac read Lingus post! he got it!

edit:
Lingus is that what your telling me?

stick online width (1680) = screen width (1680)
stick onlines new height (1061~) = stick online original height (600) * stick online new width (1680) / stick online old width (950)

see i thought all i had to do was divide one number to solve the black bars. man i was not thinking!

Lingus

Err... not sure. I'll have to look at this post again later (I'm half out the door).

ARTgames

I think i got my math up there wrong also. >_<.....

This is the basic concept i was trying to do.
http://img10.imageshack.us/img10/2329/mathnp.jpg

Now i know for sure this is right! Lingus if you say that's wrong I'm giving up. This math is NOT for me. :P

Seifer

Art, I always took you for a fool since you can't write. But it turns out your actually quite the bright lad. So I just wanted to say Oh Hai, congrats on being way better than I thought you were. <3

But it's looking good. That math makes sense. I hope it works.

ARTgames

Quote from: Seifer on March 03, 2010, 11:04:04 PM
Art, I always took you for a fool since you can't write.

yeah i agree. that happens a lot. i wish i was a better writer.

Quote from: Seifer on March 03, 2010, 11:04:04 PM
But it's looking good. That math makes sense. I hope it works.
I don't agree really. Its taken me a lot of post and i mess up alot. Its not that i have intelligences, its that i like stuff that other people don't really care about. If more people cared about math i would be most likely below normal. But hey im doing it for fun.

Lingus

Quote from: ARTgames on March 03, 2010, 10:07:40 PM
I think i got my math up there wrong also. >_<.....

This is the basic concept i was trying to do.
http://img10.imageshack.us/img10/2329/mathnp.jpg

Now i know for sure this is right! Lingus if you say that's wrong I'm giving up. This math is NOT for me. :P
Okay yea that part looks right, but did you understand what I was saying about the black bar area actually being part of the game screen? This is something that I may have wrong because I don't know GM very well and/or I would have to actually test it using an AutoIt screen reader or something to see what the actual window size is when it's full screen. My thinking is that if the monitor resolution is 1680x1050, that the game window when full screen will really be 1680x1050, not 1662.5x1050 as in your calculations. In other words, the black bar area is included in the real game window size.

Even so, you still need your calculation to determine where the new coordinate will be when scaled up. Then you have to find where the coordinate will be when including the black bars (because that's the REAL coordinate within the game window if the game window includes the black bars). That's why I have two different formulas to find each coordinate.

ARTgames

#43
good point! man I'm dumb. well we know its going to center it. so lets try:

if screen_aspect < so_aspect {
  /* if the screen is taller than so's*/
....
stick_online_new_screen_draw_width = x (x of ware the game starts drawing now its window)
screen_height / 2 - stick_online_new_screen_draw_height / 2 = y

}

Use this x,y and add your offset for the new clicking spot.

krele

Quote from: ARTgames on March 04, 2010, 08:26:42 PM
good point! man I'm dumb. well we know its going to center it. so lets try:

if screen_aspect < so_aspect {
  /* if the screen is taller than so's*/
....
stick_online_new_screen_draw_width = x (x of ware the game starts drawing now its window)
screen_height / 2 - stick_online_new_screen_draw_height / 2 = y

}

Use this x,y and add your offset for the new clicking spot.

Gm has a bad scaling and fullscreen support (just to add to the list... sadly...)
Your window size in gm becomes same as your resolution... I proved this by:

1. Making an object that draws mouse_x and mouse_y vars on the screen
2. Fullscreenin the game, and dragging the mouse... The maximum x was 640x480... But in reality, that's gm's poor mouse winapi handling...
3. I looked closely, and moved a mouse one pixel away... the coordinates didn't change at all. If it changed your resolution, the mouse coordinates would update.

As simple as that.

Also art, stick_online_new_screen_draw_width is a bad script naming habit >_>...