Fullscreen/Resolution

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
acwilson96
Posts: 22
Joined: Tue Nov 26, 2013 9:55 pm

Fullscreen/Resolution

Post by acwilson96 » Tue Nov 26, 2013 10:07 pm

I am doing a small project in livecode for windows/mac use and I want to have an options menu where you can change the resolution of the game and if it is fullscreen or not, the way I planned on doing it was by having Options Menu's with 3 options: 1920x1080, 1600x900, 800x600, then a button to essentially apply these settings, the respective code is here:

Options Menu

Code: Select all

global xOfRes, yOfRes

on menuPick pItemName
   switch pItemName
      case "800x600"
         put 800 into xOfRes
         put 600 into yOfRes
         answer "800x600"
      case "1600x900"
         put 1600 into xOfRes
         put 900 into yOfRes
      case "1920x1080"
         put 1920 into xOfRes
         put 1080 into yOfRes
   end switch
end menuPick
Apply Button

Code: Select all

global xOfRes, yOfRes

on mouseUp
   revChangeWindowSize "xOfRes", "yOfRes"
end mouseUp
I also have the same setup for fullscreen/windowed mode:

Options Menu

Code: Select all

global theScreenType

on menuPick pItemName
   switch pItemName
      case "Windowed"
         put false into theScreenType 
      case "Fullscreen"
         put true into theScreenType
   end switch
end menuPick
Apply Button

Code: Select all

global theScreenType

on mouseUp
   set the fullscreen of this stack to theScreenType
end mouseUp
I am having some issues with this(hence posting on the forums ^^) and was hoping to get some help.
All help appreciated!
Alex

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fullscreen/Resolution

Post by Klaus » Tue Nov 26, 2013 11:05 pm

Hi Alex,

1. welcome to the forum! :D

2. Could you please describe the issues you are encountering?
I have no idea yet 8)


Best

Klaus

acwilson96
Posts: 22
Joined: Tue Nov 26, 2013 9:55 pm

Re: Fullscreen/Resolution

Post by acwilson96 » Tue Nov 26, 2013 11:07 pm

It appears to be something to do with the way I am taking data from the Options Menu but I have resolved the issue now, thanks for replying though!

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fullscreen/Resolution

Post by Klaus » Wed Nov 27, 2013 12:29 am

AHA!? :D





Your message contains 8 characters. The minimum number of characters you need to enter is 10.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Fullscreen/Resolution

Post by Klaus » Wed Nov 27, 2013 2:23 pm

AH! I see you left out the neccessary "break"s in your switch structure! 8)

Whatever, here a cool hint for your option button:

Code: Select all

global xOfRes, yOfRes

on menuPick pItemName
      ## Instead of checking each possible menu item, we just take what comes,
      ## set "the itemdel to "x" and handle item 1 and 2 of whatever the user has picked :-)
      set itemdel to "x"
      put item 1 of pItemName into xOfRes
      put item 2 of pItemName into yOfRes     
end menuPick
:D


Best

Klaus

Post Reply

Return to “Games”