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.
nannolo
Posts: 27 Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell
Post
by nannolo » Sat Dec 25, 2010 1:54 pm
Hi everybody
I'm creating a compass for a first person shooter game
it's a inline compass like the cod4 one or the rabcat one
I used an IGUIImage to display the compass image
and i'm translating it to show the pointer
now i need to cut off some part of the image
something like a resize of the showing area of the image
without scaling the image
Somebody can help me?
I haven't find anything like that on the API
Fury.
Posts: 25 Joined: Mon Dec 20, 2010 2:03 pm
Post
by Fury. » Sat Dec 25, 2010 2:00 pm
just show a picture with a hole above/under the compass.
you can have a different picture for every resolution and load the needed or just resize every picture at runtime before showing it.
nannolo
Posts: 27 Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell
Post
by nannolo » Sat Dec 25, 2010 2:07 pm
Hi
I don't want to hide the exceded parts with another picture
I want to cut them
before showing them on the screen
Fury.
Posts: 25 Joined: Mon Dec 20, 2010 2:03 pm
Post
by Fury. » Sat Dec 25, 2010 2:10 pm
1) yuo need a mask and a shader that merge the mask and the picture...
in that case why don't use a pre-cutted image?
2) every part you want to cut is a separed gui element. just use the api to remove it from rendering.
nannolo
Posts: 27 Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell
Post
by nannolo » Sat Dec 25, 2010 2:32 pm
:/ but the image will translate on the left and on the right
cutting manually previously i think is too laborously and hard to mantain if i want to change graphics
http://sanje.comuv.com/irrtest/test.png
this is the actual image
Fury.
Posts: 25 Joined: Mon Dec 20, 2010 2:03 pm
Post
by Fury. » Sat Dec 25, 2010 2:33 pm
you need just to change UV.
the texture coordinates in the picture. it is simple if you know how to do that.
in your case this is simple
nannolo
Posts: 27 Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell
Post
by nannolo » Sat Dec 25, 2010 3:00 pm
:/ I haven't find how to move UV texture on IGUIElements yet
Lonesome Ducky
Competition winner
Posts: 1123 Joined: Sun Jun 10, 2007 11:14 pm
Post
by Lonesome Ducky » Sun Dec 26, 2010 6:36 am
Well, IGUIImages are clipped to the rectangle of their parents. You could try creating a blank gui element, set its rect to the area you want to see, then set it as the parent of your image.
nannolo
Posts: 27 Joined: Thu Mar 20, 2008 7:56 pm
Location: Burning Hell
Post
by nannolo » Thu Jan 06, 2011 2:03 am
Thanks ducky i got the wanted effect using an empty image rect as parent for the compass