Jump to content

Search the Community

Showing results for tags 'dragging'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 13 results

  1. How to drag sprite on a path like there https://cdn-factory.marketjs.com/en/mcdonalds-playable-ad/index.html ? Thanks a lot!
  2. Hi guys, I have this problem with the latest version of the library. I added an observable to scene.onPrePointerObservable to get notifications on pointer down and up on the scene and accordingly set a variable _isPointerDown to true or false, in the same way is done in FramingBehavior to detect the user is moving the scene. When I make a single click on the scene I correctly receive the two notifications for the pointer down and pointer up events. The problem occurs when I do dragging (moving the camera). I receive the notifications for pointer down and pointer move, even in the
  3. i am using dragging example of pixijs and using simple 100x100 image but that is displaying very large (300x300). I used the cdn linking script to link pixi js framework. How can I make the image smaller and put bounds so that the image wont go beyond those bounds test.html
  4. View the jsfiddle demonstrating the issue (just click and drag the circle - relevant code on line 102). When I add a circle to the stage with Pixi.Graphics and drawCircle( 150, 100, 50 ), the circle when dragged becomes offset by it's position ( +150, +100 ) in the Graphics container. (and if we request the circle.position it's also inaccurate) What's the best way to add a shape to the screen and set it's position if it's not through a Graphics container?
  5. I am kind of lost in this events system. I have a button which when i press it creates new graphics object. I want to be able to drag this object while the mouse button is down and when I release it this object should be destroyed. Tried several things but I am lost in sending context objects. How this functionality should be done correctly? ( I remember in Flash was easy, just use startDrag() and the newly created object start to follow the mouse as you move it) Here is my sample code which works partially: var horizontalBaffleBtn = null, horzBaffle = null; h
  6. Hello again, I have followed the great advices given me here in the forum and have extended PIXI.Container to create draggable letter tiles for my word game. Here is my current implementation however I have now a problem with dragging (so I have opened a new topic) - "use strict"; function SmallTile() { PIXI.Container.call(this); this.interactive = true; this.buttonMode = true; this.dragging = false; this .on('mousedown', onDragStart) .on('touchstart', onDragStart) .on('mouseup', onDr
  7. Hi, What we would like to do in a game UI is that something like a vertical scrollable/dragging table which lists items e.g. some weapons. So we create a container, then add a large image as background. And then add some items on top of background. The background image is draggable like the dragging example http://pixijs.github.io/examples/index.html?s=demos&f=dragging.js&title=Dragging and the items are set up with click event. Thing works great except if you mouse down on a clickable item and try to drag the table. It fails since the mouse down event of the background
  8. Hi All, I am trying develop a game that contains a color band of 5 different colored rectangles. So I created a group and added those rectangles to it(I have uploaded the image of the output). Now I am trying to write the code in such a way that the entire group will be moving horizontally once I drag it. But from what I found we can make the individual element in the group draggable but not the entire group. Anyways, I did write the code this way but I think its wrong as its not working. Here it is. var leftRectGroup = game.add.group(); var colorarray = ["0x607D8B", "0xFF5722", "0xFF
  9. I'm having a strange issue, I have not encountered before. When dragging a sprite over another sprite, mouse events underneath dragged sprite are not firing. For example if I have a SpriteA, which has mouseover event. If I simply drag my mouse over it, event would work just fine. However, if i'm dragging another sprite (SpriteB) over SpriteA, mouseover event of SpriteA is not detected. I know I have done this before where it worked, but I cant figure out whats going on right now. Is there some setting that allows a sprite to be "click-through" ? Thank you! Edit: Just in case i
  10. Hi, I'm relatively new to Pixi. I have a problem similar to the one mentioned in this post: http://www.html5gamedevs.com/topic/5766-bunny-drag-example-with-correct-mouse-offset/?hl=%2Bdrag+%2Bpixi I used the code from the post and it worked seamlessly. However, when i began rotating the Sprites the offset became wrong, and the sprite jumps to another location when i begin dragging it. Do i have to use some trigonometric function to reverse the rotation? How can I do this? Here is a version with rotation: http://jsfiddle.net/cXfpq/2/ Here without rotation: http://jsfiddle.net/dirkk0/c
  11. Hello there. Been playing with Phaser, it's pretty cool. Not sure if this has been asked before, I tried fairly hard in order to answer this on my own. I have a sprite (a space ship) that has has had input.enableDrag set for it. This works without issue. I have also enabled arcade physics. Which also work fine. The issue here is that when I drag the sprite the body associated with the sprite, the body lags behind on movement. This creates an interesting "race condition" where the body is updating to the position that the sprite actually is at, and in turn is having the wrong collision loca
  12. Hi, I'm porting some cocoa code over to TypeScript and I'm currently working on the virtual joystick code. I noticed that if a mouse/touch is down and moving, update() will be sent twice. At least it appears that way. You can see an example of the anomaly here: http://www.sputnikgames.com/test/ If you constantly move your finger while holding the joystick thumb pad, the fish will move faster than if you hold your finger still on a direction with the thumb pad. The virtual joystick class has an update() method that's called by Phaser. If I remove it's update method and simply call a
  13. Hi, is it possible to check if a sprite collides with others while dragging it? I am trying to build a game where you can rearange items, but physics/collision detection seems to be deactivated for the dragged sprite. Therefore items will overlap. I need a solution to prevent overlapping. Anything included in Phaser? So far I tried this: game.physics.collide(group, group); It works as expected for falling items, but not while dragging. Thank you Mario
  • Create New...