Torque 2D, I have got to be an idiot, this can't be that hard.
by name2 · in Torque Developer Network · 01/31/2011 (2:36 pm) · 4 replies
A short time ago, I got a refund for purchasing Torque 2D. I was having too much trouble figuring out basic layout characteristics. GG was awesome, and they refunded me. Elsewhere it turns out, I'm just as stupid. No more comment on that.
I would like to come back to Garage Games, especially now that your making a comeback. However, it won't do me any good to end up with the same problem again, so here I am with a big howto question.
If someone could please help me with this, it can determine everything for me as far as Torque 2D is concerned. I will get the demo after I post this, so I am ready to try out whatever fix anyone can provide.
I have a square sprite. Its simply a 48x48 red rectangle filled with green. It's a test sprite.
I have a 1280x1024 resolution screen. I would like to move the sprite from the left edge of the screen, to the right edge of the screen. This is simple also, but the problem I was having was maintaining a pixel to pixel resolution of the sprite and anything else on the screen.
When working with Torque, nothing is pixel perfect. It's necessary for me to be pixel by pixel accurate, because the idea is to use pixel art type backgrounds and sprites. Working with Torque was like working with a bad JPEG. I have got to be doing something wrong. I can't be this stupid but it seems I am. So I am using a test sprite that I want to move from the left edge to the right, to make sure I can setup pixel by pixel matching in design view. At least that is what I tried to do back a few months ago. I am ready to try again. Someone please HELP me with this. How in the world can I get a pixel accurate layout and a final pixel accurate display. The game for now would need to be 1280x1024 fullscreen, but in the future I will want better resolution, which has to just work anyway right? I mean resolution constraint should not be affected by layout constraints.
So anyone, how do I get a pixel by pixel accurate layout and final game output. Any links any examples, anything, just someone fix this. I want to use Torque 2D again, especially now.
Thank you,
I have got to be doing this wrong.
I would like to come back to Garage Games, especially now that your making a comeback. However, it won't do me any good to end up with the same problem again, so here I am with a big howto question.
If someone could please help me with this, it can determine everything for me as far as Torque 2D is concerned. I will get the demo after I post this, so I am ready to try out whatever fix anyone can provide.
I have a square sprite. Its simply a 48x48 red rectangle filled with green. It's a test sprite.
I have a 1280x1024 resolution screen. I would like to move the sprite from the left edge of the screen, to the right edge of the screen. This is simple also, but the problem I was having was maintaining a pixel to pixel resolution of the sprite and anything else on the screen.
When working with Torque, nothing is pixel perfect. It's necessary for me to be pixel by pixel accurate, because the idea is to use pixel art type backgrounds and sprites. Working with Torque was like working with a bad JPEG. I have got to be doing something wrong. I can't be this stupid but it seems I am. So I am using a test sprite that I want to move from the left edge to the right, to make sure I can setup pixel by pixel matching in design view. At least that is what I tried to do back a few months ago. I am ready to try again. Someone please HELP me with this. How in the world can I get a pixel accurate layout and a final pixel accurate display. The game for now would need to be 1280x1024 fullscreen, but in the future I will want better resolution, which has to just work anyway right? I mean resolution constraint should not be affected by layout constraints.
So anyone, how do I get a pixel by pixel accurate layout and final game output. Any links any examples, anything, just someone fix this. I want to use Torque 2D again, especially now.
Thank you,
I have got to be doing this wrong.
#2
As for getting an object to move from one side of the screen to the other, check the object's Edit tab. Under the Physics drop-down, play with the Velocity and Constant Velocity. Setting X velocity to an integer above 0 will cause it to move right. The Constant Velocity fields are more useful for things like gravity.
01/31/2011 (3:24 pm)
I'm still pretty new to the engine myself, but I think that pixel-perfect accuracy might not be as perfect as you would like it to be. The best solution I can see is to simply scale up your art and tweak your collision polygons until it behaves how you think it should. If you're making 48x48 sprites, scale them up to whatever looks appropriate at the target resolution you're using, and note the scaling ratio. Just use the same scaling ratio for everything, and you'll have uniform graphics. Also, when importing your graphics, disable filtering. Set Filter Mode to "NONE" and you'll get beautiful hard-edged pixels. Actually, I wish that it just defaulted to no filtering regardless, but I suppose it makes more sense for phone games and high-res base art.As for getting an object to move from one side of the screen to the other, check the object's Edit tab. Under the Physics drop-down, play with the Velocity and Constant Velocity. Setting X velocity to an integer above 0 will cause it to move right. The Constant Velocity fields are more useful for things like gravity.
#3
in the game startup scripts the screen resolution will match the camera coordinates. So when you place an object at position 30x30 in game world it will be at 30x30 on the screen.
02/01/2011 (10:27 pm)
If you set your edit your SceneGraph in the level .t2d file to have a camera size of 1280x1024 and then set the game to start up in the desired resolution by putting something like setScreenMode(1280,1024,32,true);
in the game startup scripts the screen resolution will match the camera coordinates. So when you place an object at position 30x30 in game world it will be at 30x30 on the screen.
#4
02/07/2011 (9:29 am)
You can even make things smaller than the target resolution if you're shooting for a low-res look. 16x16 objects at 1x1 Torque resolution seem to work, just use the lowest pixel block size in your game as 1 in all resolution settings. 320x240 target resolution would be 20x15 resolution.
Torque 3D Owner Scott Warren
[Edit] I am thinking Snap To Grid and set the X and Y to smaller increments. But then I could be totally off base here.