==================================================== ==Design Document for Interface Scripting Language== ==================================================== version 0.1 - July 15, 2005 Copyright by Michael Miller Truman State University The following is the description of a scripting language that will be used for all the interfaces in our game. This will input parameters for all windows, including things like the mini-map and in-game controls. This will allow for easy customization and modification to the interface. The scripting language will be interpretted (read from text files) during loading, but will generate object-classes as needed. After loading, these interfaces will be extremely efficient and responsive. Some general notes: 1) Not case sensitive. 2) All one word parameters do not require quotes. 3) The only parameter that requires quotes is the Title, some values, and options for dropdownmenu and radiobutton. 4) True equates to 1 and False equates to 0. :::::::::::::::::::: ::::Object Types:::: :::::::::::::::::::: Button - standard OK, CANCEL, APPLY buttons Description - text only, displayed to the screen DropdownMenu - a selectable menu with a limited number of available selections Outlines - for display purposes only, helps break up windows into sections RadioButton - circular 'choose one of these' options SliderBar - a sliding bar with linear values TextBox - a field that accepts keyboard input ToggleButton - square check on or off button Window - a window that holds all the above objects. :::::::::::::::::::::::: ::::General Commands:::: (all objects have these) :::::::::::::::::::::::: Begin - Starts a block, follow by the type of object End - Ends a block, folow by the type of object Title - The descriptive name associated with the object. Name - the name internally that the code can request data from the object UpperLeftX - the upper left corner's x-coordinate UpperLeftY - the upper left corner's y-coordinate Width - the width of the object Height - the height of the object Value - the value associated with the object ReportOnClick - sends a message to the queue if this object was clicked ::::::::::::::::::::::::: ::::Specific Commands:::: (some objects have special commands) ::::::::::::::::::::::::: ::Button:: (a button such as OK, CANCEL, APPLY) BackgroundTexture = the texture id for an image associated (useful for attack buttons, etc) ::Description:: (a display that draws text) none ::DropdownMenu:: The default selected option will be the value of the DropdownMenu Options - the number of options available (options 0 on will be used) Option0 - Option9 - accept a "string text" that will hold the display term for that object ::Outlines:: (a display that draws a box of the specified size) BorderThickness = the size in pixels of the border ::RadioButton:: (a number of circular selections, can only pick one) The default selected option will be the value of the RadioButton Options - the number of options available (options 0 on will be used) Option0 - Option9 - accept a "string text" that will hold the display term for that object ::SliderBar:: (a sliding bar that has a given range of values) (will automatically scale clicked values linearly) Showvalue = true or false - will display the value to the right of the bar if true, otherwise hidden MinValue = any floating point value accepted MaxValue = any floating point value accepted Increments = Suppose a slider was desired for Easy, Medium, and Hard settings. Increments would be set to 3 in this case. ::TextBox:: (a field to type in the name of a character, or a file save name) Data = Integer - only allows whole numbers Float - only allows numbers with decimals TextOnly - only allows letters Alphanumeric - allows all letters and numbers String - allows any valid keys Note: Default is String ::ToggleButton:: (a toggle-able box that can be clicked on or off) Value = true or false - true is clicked, false is unclicked ::Window:: BackgroundTexture = the texture id for an image associated BorderThickness = the size in pixels of the border TextSpacing = the amount of space in pixels between objects and their titles --The following are the color channels, ranging from 0 (black) to 255 (white)-- BackgroundRed, BackgroundGreen, BackgroundBlue BorderRed, BorderGreen, BorderBlue FontRed, FontGreen, FontBlue :::::::::::::::::: ::::An Example:::: :::::::::::::::::: Begin Window Title="Sound Setup" Name=Sound Width=335 Height=380 Begin Outline Title="Setup sound and music volume." UpperLeftX=10 UpperLeftY=10 End Outline Begin SliderBar Title="Sound Volume" Name=SoundVolume MinValue=0 Maxvalue=255 UpperLeftX=10 UpperLeftY=30 Width=125 End SliderBar Begin SliderBar Title="Music Volume" Name=MusicVolume MinValue=0 Maxvalue=255 UpperLeftX=10 UpperLeftY=70 Width=125 End SliderBar Begin Description Title="Additional Options:" Name=AdditionalDescription UpperLeftX=10 UpperLeftY=145 End Description Begin ToggleBox Title="3D Positional Audio" Name=3DAudio Value=true UpperLeftX=24 UpperLeftY=175 End ToggleBox Begin RadioButton Title="Effects Level:" UpperLeftX=10 UpperLeftY=195 Options=3 Value=0 Option0="All Sounds" Option1="Weapons Only" Option2="Everything but footsteps" End RadioButton Begin Description Title="Background Music" Name=BackgroundDescription UpperLeftX=210 UpperLeftY=247 End Description Begin DropdownMenu Title="" Name="BackgroundMusic" UpperLeftX=222 UpperLeftY=170 Value=1 Options=3 Option0="Invasion" Option1="UrbanStrike" Option2="Cataclysm" End DropdownMenu Begin Button Title="OK" Name=OK UpperLeftX=12 UpperLeftY=304 Width=93 Height=32 End Button Begin Button Title="Apply" Name=Apply UpperLeftX=116 UpperLeftY=304 Width=93 Height=32 End Button Begin Button Title="Cancel" Name=Cancel UpperLeftX=231 UpperLeftY=304 Width=93 Height=32 End Button End Window ::::Defaults:::: (your scripting parameters can override any of these) ::Button:: Title="Button" Name=Button1 UpperLeftX=50 UpperLeftY=50 Width=60 Height=32 Value=0 ReportOnClick=true ::Description:: Title="Text Description" Name=Description1 UpperLeftX=50 UpperLeftY=50 Width=60 Height=32 Value=0 ReportOnClick=false ::DropdownMenu:: Title="Button" Name=DropdownMenu1 UpperLeftX=50 UpperLeftY=50 Width=60 Height=32 Value=1 ReportOnClick=false Options=10 Option0="The zeroeth option" Option1="The first option" Option2="The second option" Option3="The third option" Option4="The fourth option" Option5="The fifth option" Option6="The sixth option" Option7="The seventh option" Option8="The eighth option" Option9="The ninth option" ::Outlines:: Title="Outline" Name=Outline1 UpperLeftX=50 UpperLeftY=50 Width=60 Height=32 Value=0 ReportOnClick=false ::RadioButton:: Title="Radio Button" Name=RadioButton1 UpperLeftX=50 UpperLeftY=50 Width=60 Height=32 Value=1 ReportOnClick=false Options=10 Option0="The zeroeth option" Option1="The first option" Option2="The second option" Option3="The third option" Option4="The fourth option" Option5="The fifth option" Option6="The sixth option" Option7="The seventh option" Option8="The eighth option" Option9="The ninth option" ::SliderBar:: Title="Slider Bar" Name=SliderBar1 UpperLeftX=50 UpperLeftY=20 Width=50 Height=32 ShowValue=false ReportOnClick=false Increments=0.1 MinValue=0 MaxValue=3 ::TextBox:: Title="TextBox" Name=TextBox1 UpperLeftX=20 UpperLeftY=20 Width=50 Height=32 Data=String Value="Blank Text" ReportOnClick=false ::ToggleButton:: Title="Toggle Button" Name=ToggleButton1 UpperLeftX=20 UpperLeftY=40 Width=50 Height=32 Value=false ReportOnClick=false ::Window:: Title="Default Window1" Name=Window1 UpperLeftX=50 UpperLeftY=50 Width=300 Height=300 Value=0 ReportOnClick=false BackgroundTexture=0 BorderThickness=4 TextSpacing=6 BackgroundRed=192 BackgroundGreen=192 BackgroundBlue=192 BorderRed=0 BorderGreen=0 BorderBlue=0 FontRed=0 FontGreen=0 FontBlue=0