mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-08 05:04:34 +00:00
Updates ImageAsset usage to utilize AssetRef, and standardizes the setter/getter functions and naming conventions, as well as the ability to use and bind named targets.
This commit is contained in:
parent
a858d8624e
commit
34e3f78a22
82 changed files with 1451 additions and 951 deletions
|
|
@ -67,7 +67,8 @@ void GuiChunkedBitmapCtrl::initPersistFields()
|
|||
{
|
||||
docsURL;
|
||||
addGroup("GuiChunkedBitmapCtrl");
|
||||
INITPERSISTFIELD_IMAGEASSET(Bitmap, GuiChunkedBitmapCtrl, "This is the bitmap to render to the control.");
|
||||
ADD_FIELD("bitmapAsset", TypeImageAssetRef, Offset(mBitmapAssetRef, GuiChunkedBitmapCtrl))
|
||||
.doc("This is the bitmap asset to render to the control.");
|
||||
|
||||
addField( "useVariable", TypeBool, Offset( mUseVariable, GuiChunkedBitmapCtrl ), "This decides whether to use the \"bitmap\" file "
|
||||
"or a bitmap stored in \"variable\"");
|
||||
|
|
@ -92,6 +93,21 @@ GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl()
|
|||
mTile = false;
|
||||
}
|
||||
|
||||
void GuiChunkedBitmapCtrl::_setBitmap(StringTableEntry _in)
|
||||
{
|
||||
if (mBitmapAssetRef.assetId == _in)
|
||||
return;
|
||||
|
||||
if (ImageAsset::isNamedTarget(_in))
|
||||
{
|
||||
mBitmapAssetRef.assetId = _in;
|
||||
mBitmapAssetRef.assetPtr = ImageAsset::getNamedTargetAssetPtr(_in);
|
||||
return;
|
||||
}
|
||||
|
||||
mBitmapAssetRef = _in;
|
||||
}
|
||||
|
||||
void GuiChunkedBitmapCtrl::setBitmap(const char *name)
|
||||
{
|
||||
bool awake = mAwake;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue