static void SetSizeConfig(RectNode nb, TagAttributes att, Vector2 size) { nb.width = att.getValueAsFloat("w", size.x); nb.height = att.getValueAsFloat("h", size.y); switch (att.getValueAsInteger("t", 0)) { case 1: nb.height = nb.width * size.y / size.x; break; case 2: nb.width = nb.height * size.x / size.y; break; } }
static void SetDefaultConfig(NodeBase nb, TagAttributes att) { nb.d_bBlink = att.getValueAsBool("b", nb.d_bBlink); nb.d_color = ParserColorName(att.getValueAsString("c"), 0, nb.d_color); int offsetv = att.getValueAsInteger("x", -1); if (offsetv > 0) { nb.d_bOffset = true; nb.d_rectOffset.xMin = -offsetv / 2; nb.d_rectOffset.xMax = offsetv / 2; } offsetv = att.getValueAsInteger("y", -1); if (offsetv > 0) { nb.d_bOffset = true; nb.d_rectOffset.yMin = -offsetv / 2; nb.d_rectOffset.yMax = offsetv / 2; } }
static void ParamEffectType(ref Config config, TagAttributes att) { config.effectColor = ParserColorName(att.getValueAsString("c"), 0, Color.black); config.effectDistance.x = att.getValueAsFloat("x", 1f); config.effectDistance.y = att.getValueAsFloat("y", 1f); }