• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
9
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