Game Development Community

Vector Graphics

by Ricky Taylor · in Torque Game Builder · 05/19/2005 (12:26 am) · 7 replies

Bough T2D last night. Read through the first tutorial and thought this:

Does T2D have any support for vector graphics, Ive had a look at the fxSpriteStatic2D and its just a texture rendered at a position, yah?
Eventually I'd like to make a game where there are green squares, circles, and other shapes, reacting to physics for no apparent reason :).

#1
05/19/2005 (1:11 am)
T2D doesn't have any drawing functions aside from the sprite stuff. I think it's planned for later on, but right now you'd have to use sprites. No reason you couldn't draw them in a vector-stylee though.
#2
05/19/2005 (7:38 am)
You mean kinda like this: cathodetan.blogspot.com/2005/05/dev-day-diary-gettin-purty.html ?

I'm using modified versions of Han's beam code for the "tempest" specific graphics, which works pretty well for lines and squares and such. Circles would be more of a pain.
#3
05/19/2005 (12:08 pm)
Hey Joshua, that looks pretty cool. What's the "Hans beam code" you mentioned?.

EDIT: I forgot we have google now :->

For anyone else interested, the link for the above mentioned beam code is this:
www.garagegames.com/mg/forums/result.thread.php?qt=28671

Code was posted by Hans Sjunnesson.

Cheers,
Martin
#4
05/19/2005 (2:55 pm)
:) went and did it myself, tell me how I make the object Physics compatible and Ill post it :D
I will derive classes for other shapes also ;D (Circles only ATM)
#5
05/19/2005 (3:00 pm)
Very cool, have you tried making them children of fxSceneObject2D, that way it inherits all of that
#6
05/19/2005 (3:07 pm)
Yuhu XD. It can: Move, scale, change colour (set only :(, dont kno how to return colours :-/). All the basics. Im well pleased with myself.
But I worry about this, how does it know what region the circle occupies, it doesnt!!

EDIT:

Aha!
addField("collisionGroupMask", ...
addField("collisionLayerMask", ...
addField("collisionCallback", ...
what do i do with these? LOL, how do i set the mask to a circlie :D
#7
05/20/2005 (9:10 am)
Kk, Circles now work, WITH PHYSICS :P, and TEXTURES (Circular only :-/)

Current Classes:

fxBaseShape2D
fxCircleShape2D (They're both the same class really :D)

Shall i make Triangles, Squares Etc?

How do i post a screenshot on 'ere?