public void DrawTexture(DrawStruct draw) { if (NotImage(draw.textureName.ToString())) { return; } spriteBatch.Draw( textures[draw.textureName.ToString()], // 画像の名前 draw.position, // 座標 draw.rectangle, // nullなら区切らず画像をそのまま表示 draw.color * draw.alpha, // 透明度 MathHelper.ToRadians(draw.angle), // 回転 draw.centerPos, // 中心座標 draw.scale, // 大きさ draw.effect, // 反転 0.0f); }
public void DrawNumber(DrawStruct drawStruct, int number) { if (NotImage(drawStruct.textureName.ToString())) { return; } foreach (var n in number.ToString()) { spriteBatch.Draw(textures[drawStruct.textureName.ToString()], drawStruct.position, new Rectangle((n - '0') * 32, 0, 32, 64), drawStruct.color * drawStruct.alpha, MathHelper.ToRadians(drawStruct.angle), drawStruct.centerPos, drawStruct.scale, drawStruct.effect, 0.0f); drawStruct.position.X += 32; } }