Jump to content

Search the Community

Showing results for tags 'mousedown'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

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 8 results

  1. This is my code right now to check if left or right mouse button is down: // Left button down app.stage.on("mousedown", function() { // code... }); // Right button down app.stage.on("rightdown", function() { // code... }); But it doesn't seems to be possible that both events happen at the same time. How would I check if both mouse buttons are pressed? Left and right.
  2. I'm working with PixiJS to create a web app with OS-like functionality (source here: https://github.com/steverichey/OpenGNOP) so I obviously need to have stuff related to mouse and touch events. I've tried stuff like this (based on the examples): this.interactive = true;this.mousedown = this.touchstart = this.onClick.bind(this);this.mouseup = this.touchend = this.mouseupoutside = this.touchendoutside = this.onRelease.bind(this);But it's hit or miss. BitmapText will function normally but DisplayObjectContainers may or may not, and Graphics seem to never register clicks. Is there something I'm missing? It appears that all of these elements should support mouse and touch events.
  3. Hey all, I am trying to make a very basic prototype of a Paint-like applications. Is it possible to bind a mousemove event to the Stage that I create? If I bind an event like this: el = this.renderer.view;el.addEventListener('mousemove', function(e){ console.log('move); });I don't get a log event, so I assume that Pixi is catching and squashing the event. What's the Pixi way of binding mousedown, mousemove, and mouseup events to a Stage instance? Do I need to create an interactive, but transparent Graphics instance to cover the entire thing and have it handle the events? Thanks!
  4. Hi, I am trying to to use the code from an example for dragging sprites to let me count the number of times a sprite has been clicked. I want to place sprites on the screen that will serve as buttons that will tell the stage to addChild new Sprites. I have been able to place a button and cause that button being pressed to generate one new sprite, but now I want to generate more exactly like it. And I am not sure how to do this. Also, I am not sure if placing the logic to create a new sprite inside the mousedown function curly braces is the best way to be creating the first sprite to begin with. See my code snippet below for an example. addResistor.mousedown = addResistor.touchstart = function(data){ // stop the default event... data.originalEvent.preventDefault(); // store a reference to the data // The reason for this is because of multitouch // we want to track the movement of this particular touch this.data = data; this.alpha = 0.9; this.dragging = true; stage.addChild(resistor); }; addResistor is the sprite that serves as the button and resistor is the sprite that gets added. I had thought of using a counter variable declared outside the curly braces and passed in, but this doesn't seem to work. I am open to creating a slightly different resistor each time by addChilding one labeled R1 for the first push, and R2 for the second push if creating duplicate Sprites is not possible/ too difficult.
  5. Hello, I have been doing tests with PixiJS because I have seen good results in the examples. When I have make a code with 400 objects, the renderer is very slow. These are the lines: graphics.mousedown = graphics.touchstart = function(evt) { this.clear(); renderer.render(stage); // slooooowww };I have uploaded a JsFiddle example of the code: http://jsfiddle.net/rnr8277a/. I think I am doing something bad. Very thanks!
  6. Hi! I have developed many demos with Panda.js, but today I tried one of them and mousedown event (on sprite) suddenly stopped working. It works in browser but not in CocoonJS launcher or cocoonJS packaged APK. I did not changed CocoonJS launcher, I also built the APK with same (1.4.7) version nor did I changed Panda.js. There are no errors shown in Chrome debug window nor in CocoonJS debug mode. Because I couldnt find any errors and I stripped the code entirely I updated Panda.js to new version and now I get an error in CocoonJS launcher debug mode: Javascript Exception (Tag: 'touchend'): TypeError: Cannot read property '70' of undefined at PIXI.InteractionManager.onTouchEnd(src/engine/renderer.js:3757:33) at HTMLCanvasElement. <anonymous> (src/engine/core.js:572:18) My source code: game.module( 'game.main' ) .require( 'engine.core') .body(function() { game.addAsset('media/backi.png', 'start'); game.addAsset('media/countdown.png', 'menu'); SceneStart = game.Scene.extend({ backgroundColor: 0x000000, init: function() { this.ozadje = new game.Sprite('start'); this.ozadje.anchor.set(0, 0); this.ozadje.position.set(0,0); this.ozadje.interactive = true; this.ozadje.mousedown = function(){ game.system.setScene(SceneMenu); }; this.stage.addChild(this.ozadje); }});SceneMenu = game.Scene.extend({ backgroundColor: 0x000000, init: function() { this.ozadje2 = new game.Sprite('menu'); this.ozadje2.position.set(0,0); this.ozadje2.anchor.set(0, 0); this.stage.addChild(this.ozadje2); } }); game.System.idtkScale = 'ScaleAspectFill'; game.start(SceneStart, 480, 800); }); And you can download .zip for uploading to CocoonJS here: http://89.212.238.92/Journey/chick_debug.zip
  7. For point-and-click game, or another one, that suggests to use only clicks, is it better to use standard 'onmousedown' event, or do touch events have smaller/bigger response time? Or it depends only on framerate and the best one is to put one of them in RAF call? Will RAF calls go faster, if framerate will be low, for example, <15?
  8. Hi, I just upgraded to the latest Pixi version - and it seems like the following code which worked with Pixi version 1.2 does not work anymore: var stage, renderer;stage = new PIXI.Stage(0x000033, true);renderer = PIXI.autoDetectRenderer(320, 480, myCanvas);stage.mousedown = function() { console.log( "Action" );}; What has changed? Best,benny!
×
×
  • Create New...