Vishal Gupta

Members
  • Content count

    13
  • Joined

  • Last visited

About Vishal Gupta

  • Rank
    Member
  • Birthday 11/17/1984

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Vishal Gupta

    Box2d contact

    Thanks Tom its working great. thanks a ton
  2. Vishal Gupta

    Box2d contact

    Hi Tom, i have tried this code but its not working i am having a circle inside a circle i have an object when they collide i needs the point of collide so that i can play animation on object touch the circle boundary.
  3. Vishal Gupta

    Box2d contact

    Thanks Tom i will try and let you know.
  4. Vishal Gupta

    Box2d contact

    Hi I am using phaser box2d plugin and using setBodyContactCallback for getting call back when body touch how can i get the touching point x and y so that i can play some animation there. The call back params are body1 body2 fixture1 fixture2 callback
  5. Vishal Gupta

    Graphics with texture image

    Hi All, i have a texture image and i want to create some graphics like line, circle, rectangle with that texture image. How can i do that with bitmap data and graphics??
  6. Vishal Gupta

    Moving sprite around arc

    Thanks drhayes, I will try and let you know
  7. Vishal Gupta

    Moving sprite around arc

    Hi All, i have to move a sprite on an arc, I have start angle and end angle now i have to move the sprite on arc in loop with reverse effect. i am using tween to do this like on onUpdateCallback i set the position of sprite with radius*Math.sin() and radius*Math.cos() but its not working perfectly. so is there any way by which i can find the value between start and end angle either in increasing order or in decreasing order so that i can make my sprite animate. This is the code currently i am using var diff = this.endAngle-this.startAngle, delta = 2*diff/(60*cnf.moveSpeed), n = 0, tw = game.add.tween({a:1}).to({a:"+1"}, cnf.moveSpeed*1000, "Linear",false,0,-1), fullCircle = (cnf.path.pathArcEnd - cnf.path.pathArcStart)%360 == 0; if(!fullCircle) tw.yoyo(true); var angle = this.startAngle > this.endAngle ? this.endAngle : this.startAngle; var a = angle - delta*n, x = radius*Math.sin(a), y = radius*Math.cos(a); this.ball.position.set(x,y); tw.onUpdateCallback(function(a,b,c){ var a = angle + delta*n, x = radius*Math.sin(a), y = radius*Math.cos(a); this.ball.position.set(x,y); n = c.inReverse ? n-1 : n+1; },this); tw.start();
  8. Vishal Gupta

    Moving Sprite infinite

    Thanks,
  9. Vishal Gupta

    Phaser preloader problems

    Hi Joetan, I think you should place a check for number of files loaded like below, You must call this before load start game.load.onFileComplete.add(function(progress, cacheKey, success, totalLoaded, totalFiles){ if(game.load.totalQueuedFiles() === 0){ // this.game.state.start('GameState'); this.startPlay(); // start game from here } }, this);
  10. Vishal Gupta

    Moving Sprite infinite

    Hi All, I want to make effect of moving a sprite in loop infinitely like i have a chain image and i want to move its y position on update so it looks like its running all time.
  11. Vishal Gupta

    Make Jpeg Transparent

    Thanks for the reply and the way you guys suggests. although i am able to do this thing by using Phaser Bitmap data. by using replaceRGB with changing black or white color to any color with alpha 0. var sprite = new Phaser.Image(game,0,0,'clock',1); var sprite2 = new Phaser.Image(game,0,0,'clock',0); var bmd = game.make.bitmapData(53,40); bmd.load(sprite); bmd.replaceRGB(0, 0, 0, 255, 0, 0, 0, 0); var bmd1 = game.make.bitmapData(53,40); bmd1.alphaMask(sprite2,bmd); game.add.image(400, 0, bmd1);
  12. Vishal Gupta

    Make Jpeg Transparent

    How to make jpeg transparent(i think it can be done with bitmap data but how)? In the attached image i just need a clock image without black background the process i am thinking is make the second frame jpeg bitmap transparent and mask the first frame.
  13. Hi I am creating a graphics arc and adding it into sprite. the graphics size is different than sprite size var graphics = game.add.graphics(cx,cy); graphics.clear(); graphics.beginFill(0x00FF00); graphics.arc(0,0, 15, 0,3.14*2, false); graphics.endFill(); var ui = new Phaser.Image(game,0,0); ui.addChild(graphics); console.log(ui.width,ui.height); console.log(graphics.width,graphics.height); Both console must give same output??