本文整理汇总了C++中VariantType::SetVector4方法的典型用法代码示例。如果您正苦于以下问题:C++ VariantType::SetVector4方法的具体用法?C++ VariantType::SetVector4怎么用?C++ VariantType::SetVector4使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VariantType
的用法示例。
在下文中一共展示了VariantType::SetVector4方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UIStaticText
YamlNode * UIStaticText::SaveToYamlNode(UIYamlLoader * loader)
{
YamlNode *node = UIControl::SaveToYamlNode(loader);
UIStaticText *baseControl = new UIStaticText();
//Temp variable
VariantType *nodeValue = new VariantType();
//Control Type
SetPreferredNodeType(node, "UIStaticText");
//Font
//Get font name and put it here
nodeValue->SetString(FontManager::Instance()->GetFontName(this->GetFont()));
node->Set("font", nodeValue);
//TextColor
nodeValue->SetVector4(Vector4(textColor.r, textColor.g, textColor.b, textColor.a));
node->Set("textcolor", nodeValue);
// ShadowColor
nodeValue->SetVector4(Vector4(shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a));
node->Set("shadowcolor", nodeValue);
// ShadowOffset
nodeValue->SetVector2(GetShadowOffset());
node->Set("shadowoffset", nodeValue);
//Text
nodeValue->SetWideString(GetText());
node->Set("text", nodeValue);
//Multiline
if (baseControl->textBlock->GetMultiline() != this->textBlock->GetMultiline())
{
node->Set("multiline", this->textBlock->GetMultiline());
}
//multilineBySymbol
if (baseControl->textBlock->GetMultilineBySymbol() != this->textBlock->GetMultilineBySymbol())
{
node->Set("multilineBySymbol", this->textBlock->GetMultilineBySymbol());
}
//fitting - STRING OF INT???
if (baseControl->textBlock->GetFittingOption() != this->textBlock->GetFittingOption())
{
node->Set("fitting", this->textBlock->GetFittingOption());
}
// Align
node->SetNodeToMap("textalign", loader->GetAlignNodeValue(this->GetTextAlign()));
// Draw type. Must be overriden for UITextControls.
node->Set("drawType", loader->GetDrawTypeNodeValue(this->GetBackground()->GetDrawType()));
SafeDelete(nodeValue);
SafeRelease(baseControl);
return node;
}
示例2: DeleteKey
void KeyedArchive::SetVector4(const String & key, const Vector4 &value)
{
DeleteKey(key);
VariantType *variantValue = new VariantType();
variantValue->SetVector4(value);
objectMap[key] = variantValue;
}
示例3: VariantType
YamlNode * UITextField::SaveToYamlNode(UIYamlLoader * loader)
{
YamlNode *node = UIControl::SaveToYamlNode(loader);
//Temp variable
VariantType *nodeValue = new VariantType();
//Control Type
SetPreferredNodeType(node, "UITextField");
//Text
nodeValue->SetWideString(this->GetText());
node->Set("text", nodeValue);
//Font
//Get font name and put it here
nodeValue->SetString(FontManager::Instance()->GetFontName(this->GetFont()));
node->Set("font", nodeValue);
//TextColor
Color textColor = GetTextColor();
nodeValue->SetVector4(Vector4(textColor.r, textColor.g, textColor.b, textColor.a));
node->Set("textcolor", nodeValue);
// ShadowColor
Color shadowColor = GetShadowColor();
nodeValue->SetVector4(Vector4(shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a));
node->Set("shadowcolor", nodeValue);
// ShadowOffset
nodeValue->SetVector2(GetShadowOffset());
node->Set("shadowoffset", nodeValue);
// Text align
node->SetNodeToMap("textalign", loader->GetAlignNodeValue(this->GetTextAlign()));
// Draw Type must be overwritten fot UITextField.
UIControlBackground::eDrawType drawType = this->GetBackground()->GetDrawType();
node->Set("drawType", loader->GetDrawTypeNodeValue(drawType));
SafeDelete(nodeValue);
return node;
}
示例4: path
//.........这里部分代码省略.........
{
node->RemoveNodeFromMap("spriteModification");
}
//States cycle for values
for (int i = 0; i < STATE_COUNT; ++i)
{
//Get sprite and frame for state
Sprite *stateSprite = this->GetStateSprite(stateArray[i]);
int32 stateFrame = this->GetStateFrame(stateArray[i]);
if (stateSprite)
{
//Create array yamlnode and add it to map
YamlNode *spriteNode = new YamlNode(YamlNode::TYPE_ARRAY);
FilePath path(stateSprite->GetRelativePathname());
path.TruncateExtension();
String pathname = path.GetFrameworkPath();
spriteNode->AddValueToArray(pathname);
spriteNode->AddValueToArray(stateFrame);
int32 modification = stateBacks[BackgroundIndexForState((eButtonDrawState)i)]->GetModification();
spriteNode->AddValueToArray(modification);
node->AddNodeToMap(Format("stateSprite%s", statePostfix[i].c_str()), spriteNode);
}
//StateDrawType
UIControlBackground::eDrawType drawType = this->GetStateDrawType(stateArray[i]);
if (baseControl->GetStateDrawType(stateArray[i]) != drawType)
{
node->Set(Format("stateDrawType%s", statePostfix[i].c_str()), loader->GetDrawTypeNodeValue(drawType));
}
//leftRightStretchCap
float32 leftStretchCap = this->GetActualBackground(stateArray[i])->GetLeftRightStretchCap();
float32 baseLeftStretchCap = baseControl->GetActualBackground(stateArray[i])->GetLeftRightStretchCap();
if (baseLeftStretchCap != leftStretchCap)
{
node->Set(Format("leftRightStretchCap%s", statePostfix[i].c_str()), leftStretchCap);
}
//topBottomStretchCap
float32 topBottomStretchCap = this->GetActualBackground(stateArray[i])->GetTopBottomStretchCap();
float32 baseTopBottomStretchCap = baseControl->GetActualBackground(stateArray[i])->GetTopBottomStretchCap();
if (baseTopBottomStretchCap != topBottomStretchCap)
{
node->Set(Format("topBottomStretchCap%s", statePostfix[i].c_str()), topBottomStretchCap);
}
//State align
int32 stateAlign = this->GetStateAlign(stateArray[i]);
int32 baseStateAlign = baseControl->GetStateAlign(stateArray[i]);
if (baseStateAlign != stateAlign)
{
node->AddNodeToMap(Format("stateAlign%s", statePostfix[i].c_str()), loader->GetAlignNodeValue(stateAlign));
}
//State font, state text, text color, shadow color and shadow offset
if (this->GetStateTextControl(stateArray[i]))
{
Font *stateFont = this->GetStateTextControl(stateArray[i])->GetFont();
node->Set(Format("stateFont%s", statePostfix[i].c_str()), FontManager::Instance()->GetFontName(stateFont));
nodeValue->SetWideString(this->GetStateTextControl(stateArray[i])->GetText());
node->Set(Format("stateText%s", statePostfix[i].c_str()), nodeValue);
Color textColor = this->GetStateTextControl(stateArray[i])->GetTextColor();
nodeValue->SetVector4(Vector4(textColor.r, textColor.g, textColor.b, textColor.a));
node->Set(Format("stateTextcolor%s", statePostfix[i].c_str()), nodeValue);
Color shadowColor = this->GetStateTextControl(stateArray[i])->GetShadowColor();
nodeValue->SetVector4(Vector4(shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a));
node->Set(Format("stateShadowcolor%s", statePostfix[i].c_str()), nodeValue);
Vector2 shadowOffset = this->GetStateTextControl(stateArray[i])->GetShadowOffset();
nodeValue->SetVector2(shadowOffset);
node->Set(Format("stateShadowoffset%s", statePostfix[i].c_str()), nodeValue);
}
// State background color
Color color = this->GetActualBackground(stateArray[i])->GetColor();
Color baseColor = baseControl->GetActualBackground(stateArray[i])->GetColor();
if (baseColor != color)
{
Vector4 colorVector4(color.r, color.g, color.b, color.a);
nodeValue->SetVector4(colorVector4);
node->Set(Format("stateColor%s", statePostfix[i].c_str()), nodeValue);
}
// State color inherittype
UIControlBackground::eColorInheritType colorInheritType = this->GetActualBackground(stateArray[i])->GetColorInheritType();
UIControlBackground::eColorInheritType baseColorInheritType = baseControl->GetActualBackground(stateArray[i])->GetColorInheritType();
if (baseColorInheritType != colorInheritType)
{
node->Set(Format("stateColorInherit%s", statePostfix[i].c_str()), loader->GetColorInheritTypeNodeValue(colorInheritType));
}
}
SafeDelete(nodeValue);
SafeRelease(baseControl);
return node;
}