Jump to content


Photo
- - - - -

Resolution Adapting Example V2!


  • Please log in to reply
13 replies to this topic

#1 nonya24

nonya24

    GMC Member

  • GMC Member
  • 174 posts

Posted 22 May 2010 - 07:54 PM

  • Title: Resolution Adapting Example
  • Description: Changes the View according to the desktop resolution. Which allows Widescreen resolutions.
  • GM Version: 8
  • Registered: Yes
  • File Type: .ZIP
  • File Size: 2Mb (V1) 600Kb (V2)
  • File Link: Download (V1) Download (V2)
  • Additional Information:

Are you annoyed when you have a widescreen (laptop or not) with a resolution of 1280x800 or even 1920x1080? This example shows how to have your game change to the desktops resolution, and how to draw the hud accordingly. No credit is needed, I just want to see more games use this method!

Edited by nonya24, 28 May 2010 - 10:47 PM.

  • 0

#2 nonya24

nonya24

    GMC Member

  • GMC Member
  • 174 posts

Posted 25 May 2010 - 06:59 PM

3 Days and still no reply?
  • 0

#3 dadio

dadio

    I miss my cupcake

  • GMC Member
  • 1847 posts
  • Version:GM:Studio

Posted 25 May 2010 - 07:10 PM

Might sound funny, but the "large" size of the file might be putting people off...
typically .gmks clock in at much much smaller sizes - maybe some think it's a virus or something.

Anyway, nice example.
I wanted to do something like this for a game I'm working on...
so it's nice to see the code there.
Would be nicer yet if you included something in it that was more typical of an actual game:
(ie: center the view on an a character/object).
  • 0

#4 nonya24

nonya24

    GMC Member

  • GMC Member
  • 174 posts

Posted 25 May 2010 - 08:45 PM

Might sound funny, but the "large" size of the file might be putting people off...
typically .gmks clock in at much much smaller sizes - maybe some think it's a virus or something.

Anyway, nice example.
I wanted to do something like this for a game I'm working on...
so it's nice to see the code there.
Would be nicer yet if you included something in it that was more typical of an actual game:
(ie: center the view on an a character/object).

Ahh, I see.

I'll fix it when I get the time.

Anyway thanks for the reply :lol:
-Nonya
  • 0

#5 Newly Discovered

Newly Discovered

    Harmonious Genius

  • New Member
  • 2467 posts
  • Version:GM8

Posted 25 May 2010 - 10:44 PM

looks good, and well done on presentation.
  • 0

#6 THE_GAME_EDITOR

THE_GAME_EDITOR

    GMC Member

  • GMC Member
  • 809 posts
  • Version:GM8.1

Posted 26 May 2010 - 01:59 PM

Thanks!
Great idea. :)
  • 0

#7 nonya24

nonya24

    GMC Member

  • GMC Member
  • 174 posts

Posted 28 May 2010 - 10:48 PM

Version 2 Uploaded: Smaller Size, and now has a playable game in it.
  • 0

#8 Dylan93

Dylan93

    GMC Member

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 29 May 2010 - 10:18 AM

Doesnt work when I put it in my topdown engine, the letters are still distorded and the mouse positions are screwed up.
  • 0

#9 nonya24

nonya24

    GMC Member

  • GMC Member
  • 174 posts

Posted 29 May 2010 - 05:52 PM

Doesnt work when I put it in my topdown engine, the letters are still distorded and the mouse positions are screwed up.

Set the room and view sizes to a very large number. And enable the first View.

Make sure you have this script in your Create or Room Start Event:

global.resolution_w = display_get_width()
global.resolution_h = display_get_height()
view_wview[0] = global.resolution_w
view_hview[0] = global.resolution_h
view_wport[0] = global.resolution_w
view_hport[0] = global.resolution_h
window_set_region_size(global.resolution_w,global.resolution_h,true)

  • 0

#10 Dylan93

Dylan93

    GMC Member

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 29 May 2010 - 09:24 PM

Doesnt work when I put it in my topdown engine, the letters are still distorded and the mouse positions are screwed up.

Set the room and view sizes to a very large number. And enable the first View.

Make sure you have this script in your Create or Room Start Event:

global.resolution_w = display_get_width()
global.resolution_h = display_get_height()
view_wview[0] = global.resolution_w
view_hview[0] = global.resolution_h
view_wport[0] = global.resolution_w
view_hport[0] = global.resolution_h
window_set_region_size(global.resolution_w,global.resolution_h,true)


I can try the first suggestion, the second one I already have offcourse :)
  • 0

#11 Blue Games

Blue Games

    GMC Member

  • New Member
  • 102 posts

Posted 05 September 2010 - 12:44 AM

Thank you so much for example!!
  • 0

#12 X-Games

X-Games

    GMC Member

  • New Member
  • 11 posts

Posted 05 September 2010 - 11:21 AM

Thank you very much, I will be using this in my game.
  • 0

#13 xYorYx

xYorYx

    Vampire

  • GMC Member
  • 88 posts
  • Version:GM8

Posted 14 June 2012 - 08:20 PM

*Problem is solved.*

First I want to say sorry for bumping this but the author haven't logged in almost 1 year. I examined both examples very carefully and followed everything to add this to my game, but I have 1 problem - the zone to click my buttons is not where it has to be. I mean that I have to click like 1-2cm above the button to use it. My room size is 800x600, I tried to change it and the view to 4000, but it only made it worse.

Edited by xYorYx, 17 June 2012 - 06:31 PM.

  • 1

#14 Kawasaki Games

Kawasaki Games

    GMC Member

  • New Member
  • 6 posts
  • Version:GM8

Posted 17 June 2012 - 06:21 PM

Thank you. :) This is a very helpful example for doing something I have wondered about for quite some time now.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users