本文整理汇总了C#中Cocos2D.CCBReader.ReadFloat方法的典型用法代码示例。如果您正苦于以下问题:C# CCBReader.ReadFloat方法的具体用法?C# CCBReader.ReadFloat怎么用?C# CCBReader.ReadFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cocos2D.CCBReader
的用法示例。
在下文中一共展示了CCBReader.ReadFloat方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParsePropTypeColor4FVar
protected virtual CCColor4F[] ParsePropTypeColor4FVar(CCNode node, CCNode parent, CCBReader reader)
{
float red = reader.ReadFloat();
float green = reader.ReadFloat();
float blue = reader.ReadFloat();
float alpha = reader.ReadFloat();
float redVar = reader.ReadFloat();
float greenVar = reader.ReadFloat();
float blueVar = reader.ReadFloat();
float alphaVar = reader.ReadFloat();
var colors = new CCColor4F[2];
colors[0].R = red;
colors[0].G = green;
colors[0].B = blue;
colors[0].A = alpha;
colors[1].R = redVar;
colors[1].G = greenVar;
colors[1].B = blueVar;
colors[1].A = alphaVar;
return colors;
}
示例2: ParsePropTypeFloatScale
protected virtual float ParsePropTypeFloatScale(CCNode node, CCNode parent, CCBReader reader)
{
float f = reader.ReadFloat();
int type = reader.ReadInt(false);
if ((CCBScaleType) type == CCBScaleType.MultiplyResolution)
{
f *= CCBReader.ResolutionScale;
}
return f;
}
示例3: ParsePropTypeFloatVar
protected virtual float[] ParsePropTypeFloatVar(CCNode node, CCNode parent, CCBReader reader)
{
float f = reader.ReadFloat();
float fVar = reader.ReadFloat();
var arr = new float[2];
arr[0] = f;
arr[1] = fVar;
return arr;
}
示例4: ParsePropTypeFloat
protected virtual float ParsePropTypeFloat(CCNode node, CCNode parent, CCBReader reader)
{
return reader.ReadFloat();
}
示例5: ParsePropTypeDegrees
protected virtual float ParsePropTypeDegrees(CCNode node, CCNode parent, CCBReader reader, string propertyName)
{
float ret = reader.ReadFloat();
if (reader.AnimatedProperties.Contains(propertyName))
{
CCBValue value = new CCBValue(ret);
reader.AnimationManager.SetBaseValue(value, node, propertyName);
}
return ret;
}
示例6: ParsePropTypeScaleLock
protected virtual float[] ParsePropTypeScaleLock(CCNode node, CCNode parent, CCBReader reader, string propertyName)
{
float x = reader.ReadFloat();
float y = reader.ReadFloat();
var type = (CCBScaleType) reader.ReadInt(false);
CCBHelper.SetRelativeScale(node, x, y, type, propertyName);
if (reader.AnimatedProperties.Contains(propertyName))
{
var baseValue = new List<CCBValue>
{
new CCBValue(x),
new CCBValue(y),
new CCBValue((int) type)
};
reader.AnimationManager.SetBaseValue(baseValue, node, propertyName);
}
if (type == CCBScaleType.MultiplyResolution)
{
x *= CCBReader.ResolutionScale;
y *= CCBReader.ResolutionScale;
}
var scaleLock = new float[2];
scaleLock[0] = x;
scaleLock[1] = y;
return scaleLock;
}
示例7: ParsePropTypeSize
protected virtual CCSize ParsePropTypeSize(CCNode node, CCNode parent, CCBReader reader)
{
float width = reader.ReadFloat();
float height = reader.ReadFloat();
int type = reader.ReadInt(false);
CCSize containerSize = reader.AnimationManager.GetContainerSize(parent);
switch ((SizeType) type)
{
case SizeType.Absolute:
{
/* Nothing. */
break;
}
case SizeType.RelativeContainer:
{
width = containerSize.Width - width;
height = containerSize.Height - height;
break;
}
case SizeType.Percent:
{
width = (int) (containerSize.Width * width / 100.0f);
height = (int) (containerSize.Height * height / 100.0f);
break;
}
case SizeType.HorizontalPercent:
{
width = (int) (containerSize.Width * width / 100.0f);
break;
}
case SizeType.VerticalPercent:
{
height = (int) (containerSize.Height * height / 100.0f);
break;
}
case SizeType.MultiplyResolution:
{
float resolutionScale = CCBReader.ResolutionScale;
width *= resolutionScale;
height *= resolutionScale;
break;
}
default:
{
CCLog.Log("Unknown CCB type.");
}
break;
}
return new CCSize(width, height);
}
示例8: ParsePropTypePointLock
protected virtual CCPoint ParsePropTypePointLock(CCNode node, CCNode parent, CCBReader reader)
{
float x = reader.ReadFloat();
float y = reader.ReadFloat();
return new CCPoint(x, y);
}
示例9: ParsePropTypePosition
protected virtual CCPoint ParsePropTypePosition(CCNode node, CCNode parent, CCBReader reader, string propertyName)
{
float x = reader.ReadFloat();
float y = reader.ReadFloat();
var type = (CCBPositionType) reader.ReadInt(false);
CCSize containerSize = reader.AnimationManager.GetContainerSize(parent);
CCPoint pt = CCBHelper.GetAbsolutePosition(new CCPoint(x, y), type, containerSize, propertyName);
node.Position = CCBHelper.GetAbsolutePosition(pt, type, containerSize, propertyName);
if (reader.AnimatedProperties.Contains(propertyName))
{
var baseValue = new List<CCBValue>
{
new CCBValue(x),
new CCBValue(y),
new CCBValue((int) type)
};
reader.AnimationManager.SetBaseValue(baseValue, node, propertyName);
}
return pt;
}
示例10: ParsePropTypeFloatXY
protected virtual float[] ParsePropTypeFloatXY(CCNode pNode, CCNode pParent, CCBReader ccbReader)
{
float x = ccbReader.ReadFloat();
float y = ccbReader.ReadFloat();
var floatXY = new float[2];
floatXY[0] = x;
floatXY[1] = y;
return floatXY;
}