Community

The PokéCommunity

We are still working on a better slogan!

Visit Index



Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.

Post Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old August 19th, 2010, 12:10 PM
carmaniac's Avatar
carmaniac
Where the pickle surprise at?
 
Join Date: Apr 2009
Location: England
Age: 19
Nature: Relaxed
Well, this is for all of those people who keep asking how to make a touchscreen using crazyninjaguy's mouse module and dualscreen.
Which I can't link the Mouse module as you have to find it over at planetdev.net.

Well, for those who have his two scripts this is what you need to do.
To make a menu have the mouse function you need to find the loop do of the script and then do this following script:

Mouse.mouse_in_area?(x,y,width,height)

That code there sets up the area of where the mouse is going to be expected.
the x,y are the co-ordinates of where the area is located while the width and height is the area size.
For example:

Mouse.mouse_in_area?(30,30,100,100)

That's an example of a button area for instance.
The structure needed for the button to work would be this:

Mouse.mouse_in_area?(30,30,100,100)
if Mouse.click?(1)#left mouse button
do stuff# This is where you put all of the commands you want to happen
end # ends the check for the left mouse button being clicked
end# ends the check for the mouse being in a certain area.


Well that's all that's really needed to be known about the mouse script.
I will only help those who make an effort to learn .

Pokémon: Lost Souls.







Developed by Carmaniac.
  #2    
Old August 24th, 2010, 07:24 PM
Orangturttle's Avatar
Orangturttle
Magikarp MASTER!
 
Join Date: Jul 2010
Gender: Male
Nature: Jolly
Send a message via AIM to Orangturttle Send a message via Windows Live Messenger to Orangturttle Send a message via Yahoo to Orangturttle
Oh goodness! :D
Thanks bro! I'll be trying my luck with this soon.. haha. :D

  #3    
Old August 25th, 2010, 06:46 AM
Gigatom~'s Avatar
Gigatom~
Pokemon Ruthenium Creator ~
 
Join Date: Jan 2010
Age: 19
Gender: Male
Thanks for this.
A question for this: Mouse.mouse_in_area?(x,y,width,height)
Does width,height mean teh width and height from the Picture?

Gigatom~


Check out my deviantArt! :3
  #4    
Old August 25th, 2010, 06:48 AM
carmaniac's Avatar
carmaniac
Where the pickle surprise at?
 
Join Date: Apr 2009
Location: England
Age: 19
Nature: Relaxed
Quote:
Originally Posted by Gigatom~ View Post
Thanks for this.
A question for this: Mouse.mouse_in_area?(x,y,width,height)
Does width,height mean teh width and height from the Picture?

Gigatom~
Yes it does, sorry for not mentioning that but I will expand this page into more detail when I have time later on in the day.

Pokémon: Lost Souls.







Developed by Carmaniac.
  #5    
Old August 25th, 2010, 06:50 AM
Gigatom~'s Avatar
Gigatom~
Pokemon Ruthenium Creator ~
 
Join Date: Jan 2010
Age: 19
Gender: Male
Okay , thank you very much :D


Check out my deviantArt! :3
  #6    
Old August 25th, 2010, 07:51 AM
Poeman
Booted out - don't be like me!
 
Join Date: Nov 2008
Age: 19
Gender: Male
D: you have opened new things for the community, I can't believe you're handing them this.

Now is this version 1, 2, or 3?
  #7    
Old August 25th, 2010, 11:09 AM
carmaniac's Avatar
carmaniac
Where the pickle surprise at?
 
Join Date: Apr 2009
Location: England
Age: 19
Nature: Relaxed
Quote:
Originally Posted by Poeman View Post
D: you have opened new things for the community, I can't believe you're handing them this.

Now is this version 1, 2, or 3?
Shhh... Poeman XD. If I was giving the community something it would be this:
An script base to making an touchscreen menu although I'm not revealing exactly how to call the script and keep it on the screen . That is for those determined game maker enthusiasts. And at the moment version 1.

Code:
class Window_Menu < SpriteWindow_Base
  def initialize
    @sprites = {}
    @sprites[""] = Sprite.new
    @sprites[""].x = 
    @sprites[""].y = 
    @sprites[""].z = 
    
  end
  def dispose
    
  end
  def refresh
    if Mouse.mouse_in_area?(x,y,width,height)
      if Mouse.click?(1)
        
      end
    end
    
  end
end

Pokémon: Lost Souls.







Developed by Carmaniac.
  #8    
Old August 25th, 2010, 06:23 PM
Pichuichu's Avatar
Pichuichu
Creator Of (Insert Here)
 
Join Date: Apr 2010
Location: Isshu-Huin City
Gender: Male
Who persuaded you to post this? but yes this would help game developers to make touch screen games. Thanks.

Credit: Invasion For Sig And Avatar.



My Da Account ->here<-
  #9    
Old August 26th, 2010, 05:15 AM
carmaniac's Avatar
carmaniac
Where the pickle surprise at?
 
Join Date: Apr 2009
Location: England
Age: 19
Nature: Relaxed
Quote:
Originally Posted by Pichuichu View Post
Who persuaded you to post this? but yes this would help game developers to make touch screen games. Thanks.
No one, I just felt like posting something like this seeming as only a few people knew how to do it.

Pokémon: Lost Souls.







Developed by Carmaniac.
  #10    
Old August 28th, 2010, 09:20 AM
matrockista06
Beginning Trainer
 
Join Date: Jun 2009
Gender: Male
where do i paste the codes?
  #11    
Old August 29th, 2010, 04:00 PM
Pichuichu's Avatar
Pichuichu
Creator Of (Insert Here)
 
Join Date: Apr 2010
Location: Isshu-Huin City
Gender: Male
may i ask if i put the co-ordinates in the top left corner of where i want?

Credit: Invasion For Sig And Avatar.



My Da Account ->here<-
  #12    
Old August 31st, 2010, 01:24 PM
zingzags's Avatar
zingzags
Creator or Pokemon Serenity
 
Join Date: Jan 2009
Location: Boston
Age: 20
Nature: Adamant
Quote:
Originally Posted by Pichuichu View Post
may i ask if i put the co-ordinates in the top left corner of where i want?
Mouse.mouse_in_area?(co-ordinate-x,co-ordinate-y, height i think,and width i think of the button)
Pokemon Serenity is my fangame name.
name decided 12/15/09
Currently helping:
Pokemon ebony
and
Xenotime:
  #13    
Old August 31st, 2010, 01:37 PM
Pichuichu's Avatar
Pichuichu
Creator Of (Insert Here)
 
Join Date: Apr 2010
Location: Isshu-Huin City
Gender: Male
no that but do i make the co-ordinates the top left corner of the button?

Credit: Invasion For Sig And Avatar.



My Da Account ->here<-
  #14    
Old August 31st, 2010, 01:54 PM
zingzags's Avatar
zingzags
Creator or Pokemon Serenity
 
Join Date: Jan 2009
Location: Boston
Age: 20
Nature: Adamant
Quote:
Originally Posted by Pichuichu View Post
no that but do i make the co-ordinates the top left corner of the button?
Ya from the top left corner of the very top screen which is (0,0), then lets say u want a button on the bottom screen 20 pixels from each part.
sense there is a top screen and if you are using the spacer thing the start of the bottom screen will be (0,340)

and to make the button 20 pixels apart use (20,360)
Pokemon Serenity is my fangame name.
name decided 12/15/09
Currently helping:
Pokemon ebony
and
Xenotime:
  #15    
Old October 31st, 2010, 04:27 PM
Yuoaman's Avatar
Yuoaman
Legen- wait for it...
Community Supporter
 
Join Date: Jul 2005
Location: Ontario, Canada
Age: 22
Gender: Male
Nature: Relaxed
Please try to refrain from posting in topics that have not had replies in over two months from now on, Urugamosu.

Closed.

Suit Up!
Awesome REGULAR MEMBER THAT OCCASIONALLY FREQUENTS FORUMS.

"pps new screenie" - No, really shut up yuoaman.

Haaave you read my LP?
Pokémon Quartz - The only one really worth reading.

What about my [Un]Abridged series?
Aquaman the Unabridged Parody Series - Language warning.

The Playbook: My Anime List | Raptr | BackLoggery | Twitter


83% of this signature is empty space.

-dary!
Post Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 03:55 PM.

About Us
© 2002 - 2014 The PokéCommunity™, pokecommunity.com. Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.

Copyright
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com. PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator. Header artwork by Jordanice of deviantART.

Social Media
If you would like to stay up-to-date with us on the go, when we're down, or other such things, follow us on social media sites--most notibly Twitter, Facebook, and Google Plus--by clicking on the links provided.

Design presented by Peitharchia. Special thanks to Hiroshi Sotomura and Ausaudriel.