MadBeardMan
January 12th, 2019, 23:22
Evening All,
portraitwidget.getBitmap()
When I run this command, the 'portrait' gets bigger.
Here's this 'good' portrait:
25933
And here, if I run 'portraitwidget.getBitmap()' then it like this:
25934
Here's the code:
local portraitwidget = nil;
function onInit()
local linename = window.getDatabaseNode().createChild("gameline","string").getValue();
local gameline;
if super and super.onInit then
super.onInit();
end
-- set portrait, if available
if window.getDatabaseNode() and window.getDatabaseNode().getName() then
if getName() == "portrait" then
-- full-sized portrait
portraitwidget = window.portrait.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_charlist");
end
if getName() == "smallportrait" then
-- small portrait
portraitwidget = window.smallportrait.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_token");
end
end
if portraitwidget and portraitwidget.getBitmap() and window.logo then
window.logo.setVisible(false);
end
-- set gameline-related stuff
if linename=="" then
linename = LineManager.getDefaultName();
end
gameline = LineManager.getLine(linename);
if gameline then
setTooltipText(gameline.FullName);
end
if User.isHost() then
setMenus();
end
end
And here's the code for the portrait in the character sheets:
<portrait_char name="portrait">
<bounds>-115,15,75,75</bounds>
<script file="campaign/scripts/charsheet_portrait.lua" />
</portrait_char>
So why does 'getBitmap()' make the image bigger?
Thanks,
Col
portraitwidget.getBitmap()
When I run this command, the 'portrait' gets bigger.
Here's this 'good' portrait:
25933
And here, if I run 'portraitwidget.getBitmap()' then it like this:
25934
Here's the code:
local portraitwidget = nil;
function onInit()
local linename = window.getDatabaseNode().createChild("gameline","string").getValue();
local gameline;
if super and super.onInit then
super.onInit();
end
-- set portrait, if available
if window.getDatabaseNode() and window.getDatabaseNode().getName() then
if getName() == "portrait" then
-- full-sized portrait
portraitwidget = window.portrait.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_charlist");
end
if getName() == "smallportrait" then
-- small portrait
portraitwidget = window.smallportrait.addBitmapWidget("portrait_" .. window.getDatabaseNode().getName().. "_token");
end
end
if portraitwidget and portraitwidget.getBitmap() and window.logo then
window.logo.setVisible(false);
end
-- set gameline-related stuff
if linename=="" then
linename = LineManager.getDefaultName();
end
gameline = LineManager.getLine(linename);
if gameline then
setTooltipText(gameline.FullName);
end
if User.isHost() then
setMenus();
end
end
And here's the code for the portrait in the character sheets:
<portrait_char name="portrait">
<bounds>-115,15,75,75</bounds>
<script file="campaign/scripts/charsheet_portrait.lua" />
</portrait_char>
So why does 'getBitmap()' make the image bigger?
Thanks,
Col