本文整理汇总了C++中TextObject::getBitmapWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ TextObject::getBitmapWidth方法的具体用法?C++ TextObject::getBitmapWidth怎么用?C++ TextObject::getBitmapWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextObject
的用法示例。
在下文中一共展示了TextObject::getBitmapWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gettextobject
/* Make changes to a text object based on the parameters passed
* in the table in the LUA parameter 2.
*/
void Lua_V1::ChangeTextObject() {
const char *line;
lua_Object textObj = lua_getparam(1);
int paramId = 2;
if (lua_isuserdata(textObj) && lua_tag(textObj) == MKTAG('T', 'E', 'X', 'T')) {
TextObject *textObject = gettextobject(textObj);
for (;;) {
lua_Object paramObj = lua_getparam(paramId++);
if (!paramObj)
break;
if (!lua_isstring(paramObj)) {
if (!lua_istable(paramObj))
break;
setTextObjectParams(textObject, paramObj);
textObject->reposition();
textObject->destroy();
} else {
line = lua_getstring(paramObj);
textObject->setText(line);
lua_getstring(paramObj);
}
lua_pushnumber(textObject->getBitmapWidth());
lua_pushnumber(textObject->getBitmapHeight());
}
}
}
示例2: TextObject
void Lua_V1::MakeTextObject() {
lua_Object textObj = lua_getparam(1);
if (!lua_isstring(textObj)) {
return;
}
TextObject *textObject = new TextObject(false);
const char *line = lua_getstring(textObj);
Common::String text = line;
textObject->setDefaults(&g_grim->_blastTextDefaults);
lua_Object tableObj = lua_getparam(2);
if (lua_istable(tableObj))
setTextObjectParams(textObject, tableObj);
textObject->setText(text.c_str());
lua_pushusertag(textObject->getId(), MKTAG('T', 'E', 'X', 'T'));
if (!(g_grim->getGameFlags() & ADGF_DEMO)) {
lua_pushnumber(textObject->getBitmapWidth());
lua_pushnumber(textObject->getBitmapHeight());
}
}