t2dTextObject Drop Shadow Resource
by Noby Nobriga · in iTorque 2D · 05/03/2012 (6:26 am) · 4 replies
I've created a resource for adding drop shadows to t2dTextObject objects. Includes new TorqueScript methods for t2dTextObjects.
setdropShadowOffset(offset)
getDropShadowOffset()
hasDropShadow()
setHasDropShadow()
getDropShadowColor()
setDropShadowColor(color)
www.garagegames.com/community/resources/view/21678
--Noby
setdropShadowOffset(offset)
getDropShadowOffset()
hasDropShadow()
setHasDropShadow()
getDropShadowColor()
setDropShadowColor(color)
www.garagegames.com/community/resources/view/21678
--Noby
#2
05/03/2012 (12:47 pm)
That's a good question! It's been a long time since I've really used any of the Gui stuff but I think the rendering may be done by different code. If it is different code it may not take much to transplant my changes into the Gui code. You've got me curious. I'll take a look at that when I'm back to my dev machine.
#3
05/04/2012 (6:23 am)
Wait. You mean the t2dTextObject is actually useful? I must be doing something wrong because every time I try to use the stock t2dTextObject in the editor I just get a pixelated mess of something that could only be called "text" if this were 1964 and we were still using punch cards.
#4
Use the lineHeight field to change the size of your text. This can be done in the editor. The problem is that the fontSizes field does not change to approriate value. If your lineHeight is different than your fontSizes value, the engine scales the text from the font size to the lineHeight. Make sure that whatever value you use for your lineHeight you also use for your fontSizes. (This 1:1 ratio between lineHeight and fontSizes at least works in my case.) FontSizes can hold multiple numbers. Atleast one of them needs to be your lineHeight value or a value larger. It's better to use the exact size you need. That way there's less chance of some sort of artifacting occuring during up/down-scaling.
All of this is from memory as I cannot view code at the moment.
05/04/2012 (6:56 am)
They are very useful. The problem you're seeing seems to stem from the font settings in the t2d scene file. The work around is you need to edit the font settings on your text object by hand.Use the lineHeight field to change the size of your text. This can be done in the editor. The problem is that the fontSizes field does not change to approriate value. If your lineHeight is different than your fontSizes value, the engine scales the text from the font size to the lineHeight. Make sure that whatever value you use for your lineHeight you also use for your fontSizes. (This 1:1 ratio between lineHeight and fontSizes at least works in my case.) FontSizes can hold multiple numbers. Atleast one of them needs to be your lineHeight value or a value larger. It's better to use the exact size you need. That way there's less chance of some sort of artifacting occuring during up/down-scaling.
All of this is from memory as I cannot view code at the moment.
Torque Owner Johnny Vo
Does this work with GUI text objects?