[XP] Mouse Window API

Started by Ryex, August 13, 2010, 12:42:02 pm

Previous topic - Next topic

Ryex

August 13, 2010, 12:42:02 pm Last Edit: October 01, 2011, 02:15:34 am by Ryex
Mouse Window API
Authors: Ryex
Version: 2.0
Type: Scripter API for the creation of mouse controllable windows
Key Term: Scripting Tool



Introduction

I developed this as part of Remexos, however, I decided that it was too good to deprive the community of, as such I asked for permission to release the API to the public.


Features


  • Drag-able windows
  • scrollable windows contents
  • Check box control
  • List box control
  • Button control
  • IconBox control
  • IconBox List control
  • Right Click Windows
  • hover functionality
  • data dragging
  • put an icon under the mouse when dragging data
  • all controls can be disabled
  • a window controller that handles all input and allows for easy window updating
  • a control call back system that allows a button to call a method in any currently class when clicked
  • the project comes with two sample windows featuring all the features and a sample scene that replaces the title screen to so how the API works
  • it is simple to create more controls than the ones provides in the mouse window system
  • it would be simple to add a skinning system to the API windows instead of the default black and white
  • the API is full commented



Screenshots

NA



Demo

.7z archive - can be opened with the free, open source program 7-zip
Mediafire



Script

contains only .txt files of the script's parts. full dependencies not included, see demo for all required scripts
Mediafire



Instructions

See Demo Project


Compatibility

This API Requires Blizzard's Mouse Controller and either Custom Controls from Tons of Add-ons, Blizz-ABS or RMX-OS.
It may work with another mouse system out of the box but it might take some editing of the two systems.


Credits and Thanks


  • Ryex
  • G_G, for the template of the Check box control, saved me a few hours of work



Author's Notes

This was developed as part of Remexos, please support the project. Any bugs or questions? Ask here.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


stripe103

Finally a public window script that works! :D

nathmatt

August 13, 2010, 03:56:35 pm #3 Last Edit: August 13, 2010, 03:58:18 pm by nathmatt
BTW add this so it never needs to be updated

$mouse_window_controller = Mouse_Window::Controller.new
#==============================================================================
# module Input
#==============================================================================

module Input
 
 class << Input
   alias update_Mouse_Window update
 end
 
 def self.update
   $mouse_window_controller.update
   update_Mouse_Window
 end
 
end


edit a suggestion icon buttons
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Ryex

Quote from: nathmatt on August 13, 2010, 03:56:35 pm
BTW add this so it never needs to be updated

$mouse_window_controller = Mouse_Window::Controller.new
#==============================================================================
# module Input
#==============================================================================

module Input
 
 class << Input
   alias update_Mouse_Window update
 end
 
 def self.update
   $mouse_window_controller.update
   update_Mouse_Window
 end
 
end


edit a suggestion icon buttons


scripters can do that at their own discretion
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Ryex

August 21, 2010, 03:33:08 pm #5 Last Edit: August 21, 2010, 03:46:47 pm by Ryexander
* sniff*  :'( y-you d-don't like it? *sniff*
yay moved!  :P

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

*fixes the compatibility listing and some grammar*
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

SBR*


Ryex

1.5 is out
new features and lots of functionality has been added to the existing ones
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ojp2010

Could you turn this in a CMS per say? Like create a box that calls a players items and lists them or calls a players buddy list and list them. Would being using this for RMX-OS

Ryex

It could be used to create any sort of user interface, but will I? no.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ojp2010

Alright well the direct key call isn't that big of a deal. I can live without that, but is there any way you could help me with editing this for my use? I would like to use it for a RMX-OS game I am working on. I am gathering the core system stuff right now and this script would make a great improvement to that database.

Ryex

there is no editing involved. it is a scripting TOOL. it dose nothing on its own. now if you want to use it to create a system, go right ahead, post here if you have question as to how certain things work. but don't expect me to explain everything. the classes are well commented for a reason. so that some one reading the script could figure it out on their own.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ojp2010

Alright, well thank you for the info. I am going to looking to it.

Wizered67

In the demo provided, in the item list it shows all the items in the database. How would I change it so that it only shows the items you have?

Ryex

wow, really? you couldn't just look at how the item menu dose it?
btw if you want to make an inventory be aware that the prospect is a semi difficult one
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Wizered67

I did look at how the item menu did it, but I wasn't able to get it to work.

Ryex

well the way the item menu dose it you get an array of RPG::Item/Weapon/Armor instances. then iterate through that array and create a data array that is formated properly for the iconbox_list control
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Wizered67

October 05, 2010, 07:48:08 pm #18 Last Edit: October 05, 2010, 09:04:45 pm by Wizered67
Thanks! I finnaly got it to work!  :bow:

edit: One more quick question. What does the right click window do? I saw it while looking at the test window 2, but whenever I right click on the check box it gives a "failed to create bitmap" error.

Ryex

version 2.0 is out. fixes close to 20 small errors caused by stupidity and finishes hover functionality.

read the fist post.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Wizered67

When I put the new scripts into the old demo, I get an error
Script 'Mouse_Window(Window)' line 252 No method error occured
undefined method '[]=' for nil:Nilclass

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Wizered67

October 06, 2010, 09:03:42 pm #22 Last Edit: October 07, 2010, 11:26:44 pm by Wizered67
Awesome! It works great now!

edit: I'm having issues as soon as I put RMX-OS into the demo to make sure they work right. Heres whats happening when I try to open my window.
Spoiler: ShowHide

as you can see, for some reason it isn't loading the window.

Ryex

October 08, 2010, 12:12:56 am #23 Last Edit: October 08, 2010, 12:16:20 am by Ryexander
then you built the window wrong.
and or, you failed to put the API under RMX-OS
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Wizered67

I know its been a while since anyone posted in this thread, but I have a little problem. Whenever the text below an icon changes in an iconbox_list, rather than the old text going away, the new text is just written on top. For example, my text is the amount of an item you have. If that was 5 and I got one more, it would show the 5 with a 6 written over it. I'd appreciate any help I can get. Thanks in advance Ryex.

Ryex

February 12, 2011, 10:44:02 pm #25 Last Edit: February 12, 2011, 11:05:59 pm by Ryex
hmm, I could of sworn I erased the old before writing the new text.  I'll take a look at it real quick.

EDIT: well I can't seem to reproduce this bug. the best I can tell you at the moment is to make sure that you set the window up to properly redraw the iconbox.


if you pm me a project (preferably a small test project not a full game) the reproduces this bug I'll be glad to help you out.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Wizered67

Now its just acting weird on me. I won't be able to make the demo tonight or tomorrow, but I will send it as soon as I can. I appreciate the help.

Wizered67

February 17, 2011, 11:12:16 am #27 Last Edit: February 27, 2011, 08:48:51 pm by Wizered67
Okay, I pmed you a demo. Hopefully you can help me. :haha:

edit: Hey Ryex, just making sure you got the message from me. I understand if your busy and unable to help, but I'd appreciate some help as soon as you get the chance. Thanks.

iNumPad

February 04, 2013, 01:09:20 am #28 Last Edit: February 04, 2013, 01:14:17 am by iNumPad
[Sorry to revive this topic and sorry 'bout my english. I'm from Brazil.]

Very goog script. This is wonderful. But his look is ugly.
I wish it were possible to use a Windowskin in a window that is draggable and closable.

Can i do this? How?

#Edit:
Example of Windowskin:

Ryex

you will notice that the windows have a draw background method that could be modified to draw the window skin. I don't actually have the time to do this but it should be cake for any other script-er on the forum. as for buttons and other UI elements those too have draw methods that could be easily modified provieded you can provide art to draw for them
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />