• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] input mouse and keyboard

  • 20
    Posts
    10
    Years
    • Seen Apr 26, 2020
    What's wrong with this script because if I press the right button on the panel nothing happens
    Code:
    class TestScene
    	def start
    		@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
    		@viewport.z=99999
    		@sprites={}
    		
    		@sprites["bg"]=IconSprite.new(0,0,@viewport)    
    		@sprites["bg"].setBitmap("Graphics/Pictures/Menu/background")
    		
    		@sprites["panel_1"]=IconSprite.new(0,0,@viewport)    
    		@sprites["panel_1"].setBitmap("Graphics/Pictures/Menu/panel")
    		@sprites["panel_1"].x = 3
    		@sprites["panel_1"].y = 47 
    		@sprites["panel_1"].y = 47 +200
    	end
    	
    	def update 
    		loop do
    			Graphics.update 
    			Input.update 
    			pbUpdateSpriteHash(@sprites) 
    			if Input.trigger?(Input::B) || Input.trigger?(Input::C)
    				break
    			end
    		end
    	end
    	def
    		self.update
    		self.Input 
    	end
    	
    	def terminate
    		pbDisposeSpriteHash(@sprites) 
    		@viewport.dispose
    		Graphics.update
    	end
    	
    end
    
    Input.update
    if $mouse.leftClick?(["panel_1"])
      Graphics.update
      Input.update	
      self.pbMenuClick
      @sprites["panel_1"].visible=false
    	pbSEPlay("BW2MenuSelect")
    end
    
    
    class TestSceneCall
    
    	def initialize(scene)
    		@scene = scene
    	end
    	
    	
    	def start
    		@scene.start
    		@scene.update
    		@scene.terminate
    	end
    	
    end
    
    
    
    def aa
    	scene=TestScene.new
    	screen=TestSceneCall.new(scene)
    	screen.start
    end
     
    Back
    Top