Drawing a simple 2d image on screen
by Junior b · in Torque Game Engine · 02/01/2009 (4:31 pm) · 7 replies
I've been using torque for a few days now and still not totally sure on how i'd be able to draw shapes/2d images on the screen.
Aren't there any tutorials on this kind of stuff and creating your own/blank world space and drawing objects on a given position.
EDIT: not to sound too amateur-ish (i may be rushing), it's just as you would using Microsoft XNA, draw a item on a 2d or 3d plane, then specify its vector or position and that was the end of it. I just want to do something exactly/similar, to have a 2d space (or 3d, 2d preffered) and draw things on certain position.
Thanks
Aren't there any tutorials on this kind of stuff and creating your own/blank world space and drawing objects on a given position.
EDIT: not to sound too amateur-ish (i may be rushing), it's just as you would using Microsoft XNA, draw a item on a 2d or 3d plane, then specify its vector or position and that was the end of it. I just want to do something exactly/similar, to have a 2d space (or 3d, 2d preffered) and draw things on certain position.
Thanks
#2
Just imagine a empty world, screen size 640 x 480, then draw 4 x 4 tiles on a 2d/3d coordinate system somewhere visibile on the defined world as I dont want/need a big terrain or any terrain. I want to be able to have my own world space as i'd like to implement a basic strategy game using the ancient tile map logic. After achieving this i shouldnt have any more queries hopefully.
Thank You :D
02/01/2009 (8:23 pm)
oh sorry dude, to be more specific, i would like to lay down tiles (rectangles) in a 2d or 3d space to then manipulate. As the tutorials seemed a bit intimidating as im new to scripting and there must be over a dozen script files. I really just wanted my own viewport/window, a empty world to then draw stuff on it such as those tiles(rectangles) then play with the camera , etc Just imagine a empty world, screen size 640 x 480, then draw 4 x 4 tiles on a 2d/3d coordinate system somewhere visibile on the defined world as I dont want/need a big terrain or any terrain. I want to be able to have my own world space as i'd like to implement a basic strategy game using the ancient tile map logic. After achieving this i shouldnt have any more queries hopefully.
Thank You :D
#3
Edit: Alternatively, you could just create a DTS model representing a tile, or the whole game board, and load that as a TSStatic object.
02/01/2009 (9:29 pm)
Torque doesn't really work like that. Ordinarily, you don't draw directly into the world. You create objects that can draw themselves, and place those into the world. In your case, you might create a Tile class (in C++) that draws itself as a simple square, then (using script) you'd create as many of those as you need in the correct locations.Edit: Alternatively, you could just create a DTS model representing a tile, or the whole game board, and load that as a TSStatic object.
#4
However, even if i went on with this tony, i still need the world to be somewhat small and not look like a mmo/rpg/fps terrain (basically big) i know i can reduce the mission area/possibly size of terrain but are you aware of how to constraint the game world into something more useful for a strategy game(or a board).
If you were to create a Chess, or Checkers, or Tic Tac Toe game, i really would think you'd have a tiny space with the coordinate system built to your wish , and thats my FINAL issue if you know any where for me to poke into regarding this as all the tutorials are FPS oriented (no surprise lol) but the first thing i'd imagine is digging in the openGL stuff for the engine but still would need some tips/advice lol.
02/02/2009 (4:33 am)
ahh thanx dude, i already have a class close to that :D just want it to draw a rectangle with a filled in color so i kno how to approach it later.However, even if i went on with this tony, i still need the world to be somewhat small and not look like a mmo/rpg/fps terrain (basically big) i know i can reduce the mission area/possibly size of terrain but are you aware of how to constraint the game world into something more useful for a strategy game(or a board).
If you were to create a Chess, or Checkers, or Tic Tac Toe game, i really would think you'd have a tiny space with the coordinate system built to your wish , and thats my FINAL issue if you know any where for me to poke into regarding this as all the tutorials are FPS oriented (no surprise lol) but the first thing i'd imagine is digging in the openGL stuff for the engine but still would need some tips/advice lol.
#6
The other issue is easier than you're making it, because you're thinking about it backwards. The world space is essentially infinite, no matter what you put in it. If you want it to feel smaller, then all you need to do is make sure the camera cannot move very far away from your scene. Constrain the camera, not the world.
02/02/2009 (11:45 am)
mb's link is a really good example of how to make a renderable object.The other issue is easier than you're making it, because you're thinking about it backwards. The world space is essentially infinite, no matter what you put in it. If you want it to feel smaller, then all you need to do is make sure the camera cannot move very far away from your scene. Constrain the camera, not the world.
#7
02/02/2009 (11:49 am)
Thanx you two :D, its just a bit hard as there isn't a lot of code/snippets for various implementations of game ideas about so it makes my head hurt a bit but i really appreciate ur help and response time.
Torque Owner Tony Peguero