Search the Community

Showing results for tags 'buttons'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 19 results

  1. hopgop1

    Basic Troubleshooting Help

    Hi, I'm a relative noob to javascript and Phaser, and I'm having an issue coding my first proper game. I'm using Phaser version 2.6.2 and the latest version of Chrome browser. I'm asking the user a basic maths question, but when I draw the buttons for the user to click they appear but aren't clickable. Here is the console error: And here is the code I believe to be causing the error: game.add.button(50, 250 + i * 75, "buttons", this.checkAnswer).frame = i; And there is also this bit of code to draw the button mask: this.buttonMask = game.add.graphics(50, 250); this.buttonMask.beginFill(0xffffff); this.buttonMask.drawRect(0, 0, 400, 200); this.buttonMask.endFill(); numberTimer.mask = this.buttonMask; Any help would be appreciated, if you need any extra information to help me I'll gladly provide it. Been staring at this problem for over a week and I just can't figure out what's wrong, I hope it's something simple I'm doing wrong. Thanks
  2. Hello, For a game, I need to make a 8 * 10 grid with buttons as follow : var counter = 0; for (var i = 0; i < 8; i++) { for (var j = 0; j < 10; j++) { this.btnNumbers[counter] = this.game.add.button(50 * j, 50 * i, 'check-box-rounded', this.onNumberTicked, this); counter++; } } The "onNumberTicked" event add a sprite over the button to make it feel as "checked" (I don't use buttons frames for that because I need to overlay a bigger image over a text centered on the button). My probleme, is that with about 10 buttons, onNumberTicked is called quickly, but when I add 80 buttons, I notice a big delay, maybe about ~500 ms. Is there a solution to solve this issue ? Thank you for you replies, Vince
  3. Politybuilder

    Buttons not working on Safari/iOS

    Using Phaser 2.6.2 with Safari on an iPhone, game loads up fine and seems to be running ok but can't get any response out of the buttons.
  4. negrant

    covering Observable

    Hi all! My geme have a menu_1 with buttons, if you click some button, then over an old menu_1 creates a new menu_2 with new buttons, but buttons from menu_1 react for click even if it under of new menu_2. I mean, if my button have observable PointerUp and I am creates sprite over this button, then this button react for PointerUp anyway, even under sprite, how I can hide all Observable buttons under one big sprite, that it don't react for pointer, but when I am delete my big sprite, then buttons start react on poiter again? Thank
  5. oobarbazanoo

    Create start menu in Phaser.

    How can I create start menu in Phaser? I found nothing on that.
  6. Hi, I implemented a two finger zoom using the game.camera.scale propierty to zoom the game. I also implemented a drag functionality using game.camera.x and game.camera.y propierties. But now I need to add static floating sprites, such that they are always in the same position on the screen regardless the zoom or the drag movement. But when I add them as sprites (game.add.sprite) they are affected by the camera propierties (x,y,scale). I read this and set fixedToCamera to true, it works partially, the (x,y) is static, but the when I zoom in (increase game.camera.scale) the size of the floating sprites also increases. Is there any way I could add sprites that are not dependent on the camera? Thanks!
  7. WholemealDrop

    Button Hove Effect Isn't Working

    Continuation of my Phaser game that I've been working on for the last few months. Working on a menu system now and trying to polish up the buttons with a hover state. I based my button code off of the example from Phaser. My issue stems from it doesn't work as it should. Right now it doesn't do any hover over change unless you hold down the mouse button and then move your mouse off and on the button. So rather than being able to change between the over and out images and then on click images it currently only has a change for on click and if you hold down the mouse button on a button and move the cursor out and over the button it changes.I know it is super wordy but I don't know how else to explain it. Here is my code: var newgameButton; this.newgameButton = this.game.add.button(50, 50, 'NewGame', this.newGameOnClick, this, 1, 0, 2); this.newgameButton.onInputOver.add(this.over, this); this.newgameButton.onInputOut.add(this.out, this); this.newgameButton.onInputUp.add(this.up, this); up: function() { console.log('button up', arguments); }, over: function() { console.log('button over'); }, out: function() { console.log('button out'); }, newGameOnClick: function() { this.game.state.start('LevelTut'); },
  8. I want to add controls like buttons and range sliders into the babylon.js scene. I am making an interior scene of a room. Can anyone share a link or page where i can find any info about that.
  9. spinnerbox

    Browse full list of keyboard buttons

    Is there a way to see the full list of keyboard buttons? For example Phaser.Keyboard.SPACEBAR, Phaser.Keyboard.ONE, Phaser.Keyboard.TWO etc... I cannot see these "constants" in the phaser 2.2.2 docs. For example I need dot, single quote, dash(minus), ~
  10. Hey, I have an interesting problem where in one game state (Menu) I have a button that moves me to another state (PlayState). I have many buttons in the state PlayState. For some reason, ALL of the buttons in my second state are 'clicked' when I click the first button, in the first state, before the rest of the buttons even exist. Even when the callBack function I pass to the buttons are different, they are still invoked. I have tried several approaches with no success. Here is the code for the first state. Full code can be found at: https://github.com/HawpT/BrainFloss/blob/master/Game/js/Menu.js //the first button in the Menu state var newButton = this.game.add.button(400, 300, 'ball', this.clicked, this); //the callback function for that button clicked: function () { this.game.state.start('PlayState'); } The Second State code: https://github.com/HawpT/BrainFloss/blob/master/Game/js/PlayState.js LabelButton is just a wrapper that lets me print text on my buttons that I found on this forum. //one of the buttons from the second game state onebutton = new LabelButton(soccer.game,30,570,'numbutton','1',this.actionOnClicked,this,0,0,0,0); //its call back function, blank right now actionOnClicked: function() {} //and its input up handler, which is invoked whenever the button from the first state is pushed onebutton.onInputUpHandler(this.clicked(onebutton),this); clicked: function(b) { switch(b) { case onebutton: answer += '1'; break; case twobutton: answer += '2'; break; case threebutton: answer += '3'; break; case fourbutton: answer += '4'; break; case fivebutton: answer += '5'; break; case sixbutton: answer += '6'; break; case sevenbutton: answer += '7'; break; case eightbutton: answer += '8'; break; case ninebutton: answer += '9'; break; case zerobutton: answer += '0'; break; } this.game.add.text(0,0,answer,{font: '32px Arial', fill: '#000'}); } Here is an image of my first state, in which the soccerball is the button. When the soccer ball is clicked, it takes me to my second state, here: As you can see, there is a '1' printed in the top left corner as soon as I enter this state. No buttons have been clicked. I am new to JS and Phaser, but I have worked a little with action script in the past and never run across anything like this. Any help would be much appreciated.
  11. Mattward

    Cordova Buttons do not work

    Hi, This works when I run it in cordova: game.input.onUp.add(jump, this); However this doesn't: enPlayButton.onInputDown.muff.add(PlayFunction, this); And when I change it to use the first example, like so: enPlayButton.input.onUp.add(PlayFunction, this); It still won't work.. Does anyone know why? Here is the full code if you need it: http://pastebin.com/UyPh1U9F First example is on line 1728. Second example is on line 554.
  12. TheGeekTechZone

    Xbox controller on phaser

    Hello everyone !!!! I got the Xbox controller to work on my game but I cant make the RT button work. Is there any way to do that?
  13. I am having issues getting the click events to fire for a basic Phaser.Button when running in canvas+ with cocoonJS. I am testing the app (using phaser v2.2.2) with the cocoonJS launcher (using cocoonJS v2.1.1.1) on iOS 8.1.2 on an iPhone 6. Here is what I have on a basic menu game state: var button = this.game.add.button(this.game.world.centerX - 100, 215, 'assets', null, this, 'button_play_02.png', 'button_play_01.png', 'button_play_02.png', 'button_play_01.png');button.inputEnabled = true;button.fixedToCamera = true;button.smoothed = false;button.events.onInputOut.add(function() { console.log('button event onInputOut');}, this);button.events.onInputDown.add(function() { console.log('button event onInputDown');}, this);The button image displays in canvas+ but does not fire anything when clicked/touched. In webview+ and webview it works fine. The 'assets' is a texture atlas with the images being displayed for the buttons based on transparent pngs. I have seen similar issue on other topics (see below) but found no solution that worked. Any help would be greatly appreciated. Related topics: http://www.html5gamedevs.com/topic/3980-common-phaser-cocoonjs-issues/page-13 http://www.html5gamedevs.com/topic/7167-conoonjsphaser-buttons-dont-work-even-with-canvas/
  14. SPARKY892

    Temporarily Hiding Buttons

    Hi I am currently working on a game using phaser but having problems where I want to display a button that you click once to start charging a power bar and then click again to set the power but once you do this the button should hide until the item being launched comes to rest for you to then repeat the process as needed. I have tried using button.visible = false, but nothing appears to change and outputting the value to the console shows it is false. Thanks in advance for any help
  15. I have the problem with the buttons even in CANVAS mode. Here is my game var game = new Phaser.Game(width,height, Phaser.CANVAS, 'game'); And the buttons for (var i = 0; i < 6; i++) { if(i%2==0) { this.button = this.add.button((25+90*i), (600), 'buttons', this.actionOnClick, this, 0); // this.button.anchor.setTo(-0.8, 0); } else { this.button = this.add.button((25+90*(i-1)), (785), 'buttons', this.actionOnClick, this, 0); } this.ans_text = this.add.bitmapText(60, -55, 'kuku', this.ans_style, 65); // bmpText = this.add.bitmapText this.button.addChild(this.ans_text); this.all_buttons.add(this.button); } And the Listener // what happens when i click the button actionOnClick: function (button) { var log; if(button.value==this.char_bubble.char_trans) { // right blocksound.play(); button.frame=1;} Nothing happens. I tried to switch of OpenGL on Cocoonjs launcher I use Cocoonjs 2.0.1 and phaser 2.0.4 Any suggestions?
  16. Hi! this is my first post on this forum I want to add static floating images on the Screen as a button Background scrolls but buttons remain fixed at their on position I want to use these buttons as input to the game The game i'm making with phaser is like platform game where platform runs but buttons remain fixed Thanks in advance sorry for poor English : )
  17. mtburdon

    Grouping buttons

    Hi all, I'm looking for a way to group buttons so I can animate between them. For example I have 15 levels in my game split between 3 worlds so 5 levels per world. I want to show buttons to these levels with 5 on the screen at one time, when the user clicks an arrow, the first 5 buttons slide left off screen and the next 5 slide in from the right. I initially thought of adding buttons to a group much like you do with sprites, then animating the groups on/off screen but it doesn't seem as though I can do this. What would be the correct way of doing this? Thanks, Martin
  18. As you can see here : http://test.xapient.net/phaser/touch.html i managed to make a virtual gamecontroller with gamecontroller.js (source: https://github.com/austinhallock/html5-virtual-game-controller ) the problem with this is.. its horribly slow.. the joystick is the slowest so i use the dpad but for some reason the whole game get's even slower on every restart (if you die for example and respawn - game is a 3rd slower - die again - game slows down again) furthermore it seems like an unwanted overload if you can implement nice buttons with phaser quckly.. so i made these: http://test.xapient.net/phaser/ unfortunately you can click on them with a mouse.. but no touch them.. i do not want to set a function that is triggered on touch because for my purpose i have to ask for the state.. i need something like pseudo: if (buttonLeft.isDown) { left = true; } else { left = false;} if (buttonRight.isDown) { right = true; } else { right = false;}i read through other posts and the docs for hours but i can't figure it out.. so help would be very much appreciated thx!
  19. DWboutin

    Button animation

    Hi, I want to create an animated button, how can i do it? Can i set some animations on the over, up and active states of the button? Thank you