Single-color rectangles/shapes?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ping-pong2012
Posts: 17
Joined: Mon Sep 17, 2012 8:54 pm

Single-color rectangles/shapes?

Post by ping-pong2012 »

Is there a way to make a rectangle and load a single color into it, preferably with an alpha channel?

On a similar note, is there vector graphics?
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Single-color rectangles/shapes?

Post by Mel »

You can use the draw2Dprimitive method. Using colored vertices you can draw colored shapes, and with this, you can achieve results similar to a vectorial rasterizer

http://irrlicht.sourceforge.net/docu/cl ... 42af54d140

(maybe this should be moved to the help forums?)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
ping-pong2012
Posts: 17
Joined: Mon Sep 17, 2012 8:54 pm

Re: Single-color rectangles/shapes?

Post by ping-pong2012 »

Ah, the filled square was what I was looking for. As for the other things, it seems there aren't options for rotating any of these primitives, strange.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Single-color rectangles/shapes?

Post by hybrid »

Yes, 2d primitives wree originally developed for simple GUI elements only. Thus, the API did not provide rotation and other things. You should instead use 3d elements in those cases.
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: Single-color rectangles/shapes?

Post by chronologicaldot »

@ ping-pong2012:
You could just draw a simple scene node with 4 vertices forming a rectangle.
http://irrlicht.sourceforge.net/docu/example003.html

Sorry the suggestion was so late.
Post Reply