Widget
Version: 2.02
Introduction
You've dreamed of text boxes, mouse support interfaces or drag and drop windows/icon?
This script is for you
Features
The actual support:
Ressource
http://rmxp.trebor777.net/rmxp/widget_skin.png[/img]
Screenshots
Demo
Link
Scripts:
RSC file
Here we go!!
Paste the scripts in the same order as here. right after the Aleworks scripts
http://rmxp.trebor777.net/rmxp/widgets/01_Added_functions_for_Input_module.txt
http://rmxp.trebor777.net/rmxp/widgets/02_widgets.txt
http://rmxp.trebor777.net/rmxp/widgets/03_button.txt
http://rmxp.trebor777.net/rmxp/widgets/04_check_box.txt
http://rmxp.trebor777.net/rmxp/widgets/05_Icon.txt
http://rmxp.trebor777.net/rmxp/widgets/06_Progress_bar.txt
http://rmxp.trebor777.net/rmxp/widgets/07_Scroll_bar.txt
http://rmxp.trebor777.net/rmxp/widgets/08_Text_box.txt
http://rmxp.trebor777.net/rmxp/widgets/09_Text_Box_Scroll_bar.txt
http://rmxp.trebor777.net/rmxp/widgets/10_Menu_Button.txt
http://rmxp.trebor777.net/rmxp/widgets/11_Menu_check_button.txt
http://rmxp.trebor777.net/rmxp/widgets/12_Window_Base.txt
Instructions
It requires 2 set of scripts in order to work properly:
the SDK 2.2
Aleworks Input Module 2.00
All the instructions are at the beginning at of each script.
You need to know:
Declarations can be done almost everywhere, usually inside a scene or a window.
Icons don't need a window(in this case use nil), if you use one, the icon will be inside that window.
The tooltip feature is defined in the widget class.
Widgets inherits the window's visibility at creation or each time the window's visibility changes, but not the contrary. So you can hide a window and not a text box in it.
the drag area is: the top margin.
the close window button area: is the right top corner, a square of 10px.
scroll bars appear/disappear when needed
About the progress bar... you need, in your loop/process or whatever, to increase/decrease the current_step value in order to show the progress.
Only one window or icon(see icon class) can be drag at the same time
The update or disposal widgets are executed when the window is updated or disposed. Except for Icons.
The windows features can be set dynamically, using these properties:
dragable, if true, the window can be dragged and dropped on screen.
scalable, if true, the window can be resized with the mouse by click & drag on the right bottom corner, in a square of 10px. A set of scrollbars should be defined by users.
clickable, if true, when the window is cliked, (right or left), call the On_click_left/right methods(empty by default). (Windows selectable are set to "active=true"). Also detects clicks outside the window and execute the out_click method(Windows selectable are then set to "active=false").
closable, if true, the window can be closed by clicking the right top corner,(set invisible and inactive, including all the widgets).
The widget class also provides the click event methods.
#--------------------------------------------------------------------------
# * On Click Left - Called when the mouse left button clicks the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Out Click Left - Called when the mouse left button clicks outside the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * On Click Right - Called when the mouse right button clicks the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Out Click Right - Called when the mouse rightt button clicks outside the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# Clicked - This method is called when the mouse left clicks the widget.
# Can be used if the class is child of Widget class.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# OutClicked - This method is called when the mouse left clicks outside
# the widget. Can be used if the class is child of Widget class.
#--------------------------------------------------------------------------
About tool tip:
It can be change dynamically.
It uses a string or an array of strings(for displaying more than one line). But other types will be converted to a string and then to an array of strings, just in case.
FAQ
I got some errors...?
- Well, tell me, exactly what you done, it's a bit in beta for the moment ;p, i need more test:p so go people test it!
I'm not a scripter.. how I use it??
- Hell ! What are doing here?! Go learn ruby my friend!
Compatibility
Well use some features of the SDK, but not compliant to all the rules... >_>
Credits and Thanks
MrMo for helping me, in the documentation and some correcting some code.
Author's Notes
Written originally for Netplay+ 2.0
As it's really usefull, I'm releasing it for everybody.
Version: 2.02
Introduction
You've dreamed of text boxes, mouse support interfaces or drag and drop windows/icon?
This script is for you
Features
The actual support:
- Button
- Check_Box
- Icon
- Progress Bar
- Scroll Bar
- Text Box(including a scrollbar for it)
- Menu button
- Menu_CheckButton
- Drag&Drop for icons and windows(including all widgets within it)
- Close window button
- Window_Selectable works with the mouse too
- On"Eventname" methods(On_close, on_click_left, etc...)
- Don't need to be updated or disposed
- Easily usable, and extendable
- Tool Tip/Help message
Ressource
http://rmxp.trebor777.net/rmxp/widget_skin.png[/img]
Screenshots
these pictures are quite old, but it didn't change a lot :p
Spoiler
http://blog.trebor777.net/files/netplay/icon_00.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_01.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_02.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_03.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_04.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_05.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_06.PNG[/img]
http://blog.trebor777.net/files/netplay/chat.PNG[/img]
http://blog.trebor777.net/files/netplay/prog_01.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login01.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login02.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login03.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login04.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login05.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_01.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_02.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_03.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_04.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_05.PNG[/img]
http://blog.trebor777.net/files/netplay/icon_06.PNG[/img]
http://blog.trebor777.net/files/netplay/chat.PNG[/img]
http://blog.trebor777.net/files/netplay/prog_01.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login01.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login02.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login03.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login04.PNG[/img]
http://blog.trebor777.net/files/netplay/new_login05.PNG[/img]
Demo
Link
Scripts:
RSC file
Here we go!!
Paste the scripts in the same order as here. right after the Aleworks scripts
http://rmxp.trebor777.net/rmxp/widgets/01_Added_functions_for_Input_module.txt
http://rmxp.trebor777.net/rmxp/widgets/02_widgets.txt
http://rmxp.trebor777.net/rmxp/widgets/03_button.txt
http://rmxp.trebor777.net/rmxp/widgets/04_check_box.txt
http://rmxp.trebor777.net/rmxp/widgets/05_Icon.txt
http://rmxp.trebor777.net/rmxp/widgets/06_Progress_bar.txt
http://rmxp.trebor777.net/rmxp/widgets/07_Scroll_bar.txt
http://rmxp.trebor777.net/rmxp/widgets/08_Text_box.txt
http://rmxp.trebor777.net/rmxp/widgets/09_Text_Box_Scroll_bar.txt
http://rmxp.trebor777.net/rmxp/widgets/10_Menu_Button.txt
http://rmxp.trebor777.net/rmxp/widgets/11_Menu_check_button.txt
http://rmxp.trebor777.net/rmxp/widgets/12_Window_Base.txt
Instructions
It requires 2 set of scripts in order to work properly:
the SDK 2.2
Aleworks Input Module 2.00
All the instructions are at the beginning at of each script.
You need to know:
Declarations can be done almost everywhere, usually inside a scene or a window.
Icons don't need a window(in this case use nil), if you use one, the icon will be inside that window.
The tooltip feature is defined in the widget class.
Widgets inherits the window's visibility at creation or each time the window's visibility changes, but not the contrary. So you can hide a window and not a text box in it.
the drag area is: the top margin.
the close window button area: is the right top corner, a square of 10px.
scroll bars appear/disappear when needed
About the progress bar... you need, in your loop/process or whatever, to increase/decrease the current_step value in order to show the progress.
Only one window or icon(see icon class) can be drag at the same time
The update or disposal widgets are executed when the window is updated or disposed. Except for Icons.
The windows features can be set dynamically, using these properties:
dragable, if true, the window can be dragged and dropped on screen.
scalable, if true, the window can be resized with the mouse by click & drag on the right bottom corner, in a square of 10px. A set of scrollbars should be defined by users.
clickable, if true, when the window is cliked, (right or left), call the On_click_left/right methods(empty by default). (Windows selectable are set to "active=true"). Also detects clicks outside the window and execute the out_click method(Windows selectable are then set to "active=false").
closable, if true, the window can be closed by clicking the right top corner,(set invisible and inactive, including all the widgets).
The widget class also provides the click event methods.
#--------------------------------------------------------------------------
# * On Click Left - Called when the mouse left button clicks the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Out Click Left - Called when the mouse left button clicks outside the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * On Click Right - Called when the mouse right button clicks the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Out Click Right - Called when the mouse rightt button clicks outside the widget.
# block : A block must past trough here.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# Clicked - This method is called when the mouse left clicks the widget.
# Can be used if the class is child of Widget class.
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# OutClicked - This method is called when the mouse left clicks outside
# the widget. Can be used if the class is child of Widget class.
#--------------------------------------------------------------------------
About tool tip:
It can be change dynamically.
It uses a string or an array of strings(for displaying more than one line). But other types will be converted to a string and then to an array of strings, just in case.
'Code Example for text box'
Spoiler
my_window = Window_Base.new(10,10,128,96)
my_text_box = Text_Box.new(my_window,0,0,100,50,1)
# Create a 100px wide Text Field at 0,0 in my_window, which allows to write 50 characters.
# The text box contains 1 line.
#...in the update method in your scene, just update the window:
my_window.update
#to use the text from the text box:
my_text_box.text
# you can set it:
my_text_box.text='blabalbla'
# if the box covers more than 1 line, you can need to allow new line entry:
my_text_box.nl_able=true
# If true, you need to press Shift+Enter to create a new line, (like in MSN Messenger).
# It's disabled by default.
#===========================
# if you define a window class, you can of course define widgets into it, using self:
class My_Window < Window_Base
def initialize(....)
...
@my_text_box = Text_Box.new(self,0,0,100,50,1)
end
...
end
my_text_box = Text_Box.new(my_window,0,0,100,50,1)
# Create a 100px wide Text Field at 0,0 in my_window, which allows to write 50 characters.
# The text box contains 1 line.
#...in the update method in your scene, just update the window:
my_window.update
#to use the text from the text box:
my_text_box.text
# you can set it:
my_text_box.text='blabalbla'
# if the box covers more than 1 line, you can need to allow new line entry:
my_text_box.nl_able=true
# If true, you need to press Shift+Enter to create a new line, (like in MSN Messenger).
# It's disabled by default.
#===========================
# if you define a window class, you can of course define widgets into it, using self:
class My_Window < Window_Base
def initialize(....)
...
@my_text_box = Text_Box.new(self,0,0,100,50,1)
end
...
end
Expand to see the code.
FAQ
I got some errors...?
- Well, tell me, exactly what you done, it's a bit in beta for the moment ;p, i need more test:p so go people test it!
I'm not a scripter.. how I use it??
- Hell ! What are doing here?! Go learn ruby my friend!
Compatibility
Well use some features of the SDK, but not compliant to all the rules... >_>
Credits and Thanks
MrMo for helping me, in the documentation and some correcting some code.
Author's Notes
Written originally for Netplay+ 2.0
As it's really usefull, I'm releasing it for everybody.