Submitted:|| 26th July, 2005
This article is really just for people who couldn't figure this out. Most of you likely know how, but some may not.
Note: This is the MMF version, but aside from different locations of propeties, this can still be achieved in TGF.
.::Custom Windows Made Easy
First and most important, you will need two extensions that will able you to control the window, and input actual mouse coordinates.
Window Object - Christopher Lightfoot
Mouse Object - Marcello Bastea-Forte
This may be a given, but a custom window with a normal Windows frame on top will look stupid, so you'll have to turn off the heading properties.
>>Start a new application
>>Double click on 'Properties' (not frame properties)
>>Click on 'Window'
>>Unselect 'Heading', 'Application to include menu-bar', 'Menu displayed on boot-up'
Now you have to design a custom window. Launch your favorite drawing program, and create a window with the same dimensions as your application.
>>The dimensions of your application will be shown to you in the same screen that the window properties were in.
>>Include a title, possibly a reserve space for a close buttom, and a thin frame (most likely black, but any color works)
Now that you have the prerequisites met, it's time to make this custom window work.
>>Load the extensions into MMF's first frame
>>Load 3 Hidden Counter Objects
>>Load the picture (your custom frame) as an active object, and align the picture to fit
>>Go into Event Editor
()Mouse pointer lays within zone (note: dragable area)
&Repeat while mouse key is clicked
@Set CounterA to 1
&CounterA <> 1
@Set CounterB to MouseX( "Mouse object" ) - WinLeft( "Window Object" )
@Set CounterC to MouseY( "Mouse object" ) - WinRight( "Window Object" )
()CounterA = 1
@Set Window Object Horizontal to MouseX( "Mouse object" ) - value( "CounterB" )
@Set Window Object Vertical to MouseY( "Mouse object" ) - value( "CounterC" )
()Mouse pointer lays within zone (Note: close frame area)
&User clicks with left button
@End the Application
For your game I recommend using 'Sub-App' starting from Frame 2. Just put it inside your custom window located in Frame 1, adjust it to load Frame 2, and start making your game from Frame 2 instead of Frame 1.
Thank-you, I hope you have learned something.