fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
29daa42
GUI
1local PANEL ={} 2 3function PANEL : Initialize () 4self : super () 5 6self : SetTitle ( "Settings" ) 7self : SetSize ( 256 + 128 + 8 , 256 + 8 ) 8 9self . m_pSettings =self : Add ( "ScrollPanel" ) 10self . m_pSettings : Dock ( DOCK_FILL ) 11 12local text =self . m_pSettings : AddItem ( "TextEntry" ) 13text : Dock ( DOCK_TOP ) 14 15local width , height , flags =love . window . getMode () 16 17local resolution =self . m_pSettings : AddItem ( "HorizontalSelect" ) 18resolution : Dock ( DOCK_TOP ) 19for k , res in pairs ( love . window . getFullscreenModes ()) do 20resolution : AddOption (( "%dx%d" ): format ( res . width , res . height ), ( res . width == width and res . height == height )) 21end 22 23function resolution : OnSelectOption ( num ) 24local mode =love . window . getFullscreenModes ()[ num ] 25love . window . setMode ( mode . width , mode . height ) 26gui . resize ( mode . width , mode . height ) 27end 28 29local fullscreen =self . m_pSettings : AddItem ( "HorizontalSelect" ) 30fullscreen : Dock ( DOCK_TOP ) 31fullscreen : AddOption ( "Fullscreen" ) 32fullscreen : AddOption ( "Windowed" ) 33 34local applybox =self . m_pSettings : AddItem ( "Panel" ) 35applybox : SetHeight ( 256 ) 36applybox : Dock ( DOCK_TOP ) 37end 38 39gui . register ( "SceneSettings" , PANEL , "Frame" )