joshuha
July 7th, 2007, 04:27
I have been successfull adding textwidgets and bitmapwidgets almost everywhere else but the diecontrol and I really need to do that one the most.
As it is now, the diecontrol sets the icon to whatever icon you use for the default die in the chatwindow.
However, because I use very small diecontrol fields at time I made a set of icons with a big number in the middle to easily tell what kind of die is in the slot. When I try to add a bitmapwidget (or a textwidget with just a number) nothing happens on the diecontrol. I am guessing this is because the graphic for the diecontrol is being drawn on top no matter what but I have tried bringToFront() with no success.
function onInit()
registerMenuItem("D4","d4labeled",3);
if getDice()[1] == nil then
setDice({"d4"});
end
local widget = addBitmapWidget("d4labeled");
widget.setVisible(true);
widget.setPosition("center", 1, 1 );
widget.bringToFront();
end
Using the above I see the icon properly in the menu but the icon on the diefield does not have the bitmap overlaid like I would like (and I have tried with a textWidget with no success either).
Anyone have any ideas besides totally rewriting my own diecontrol type field (which is very ugly)?
As it is now, the diecontrol sets the icon to whatever icon you use for the default die in the chatwindow.
However, because I use very small diecontrol fields at time I made a set of icons with a big number in the middle to easily tell what kind of die is in the slot. When I try to add a bitmapwidget (or a textwidget with just a number) nothing happens on the diecontrol. I am guessing this is because the graphic for the diecontrol is being drawn on top no matter what but I have tried bringToFront() with no success.
function onInit()
registerMenuItem("D4","d4labeled",3);
if getDice()[1] == nil then
setDice({"d4"});
end
local widget = addBitmapWidget("d4labeled");
widget.setVisible(true);
widget.setPosition("center", 1, 1 );
widget.bringToFront();
end
Using the above I see the icon properly in the menu but the icon on the diefield does not have the bitmap overlaid like I would like (and I have tried with a textWidget with no success either).
Anyone have any ideas besides totally rewriting my own diecontrol type field (which is very ugly)?