本文整理汇总了C#中Sprite.SetUVs方法的典型用法代码示例。如果您正苦于以下问题:C# Sprite.SetUVs方法的具体用法?C# Sprite.SetUVs怎么用?C# Sprite.SetUVs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sprite
的用法示例。
在下文中一共展示了Sprite.SetUVs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BigStar
public BigStar(TextureManager _t, int color)
{
name = "BigStar";
Texture texture = _t.Get("etama6");
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(32);
sprite.SetHeight(32);
if (color > 7)
color = 7;
if (color < 0)
color = 0;
sprite.SetUVs(color * 4 * per_256, 0, (color + 1) * 4 * per_256, 4 * per_256);
this.color = color;
}
示例2: miniRice
public miniRice(TextureManager _t, int color)
{
this.color = color;
name = "miniRice";
if (color > 15)
color = 15;
if (color < 0)
color = 0;
Texture texture = _t.Get("etama1");
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(8);
if (color <= 7)
{
sprite.SetUVs(color * per_256, 30 * per_256, (color + 1) * per_256, 31 * per_256);
}
else
{
color = color - 8;
sprite.SetUVs(color * per_256, 31 * per_256, (color + 1) * per_256, 32 * per_256);
}
}
示例3: MiddleRound
public MiddleRound(TextureManager _t, int color)
{
this.color = color;
name = "MiddleRound";
Texture texture = _t.Get("etama1");
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(16);
sprite.SetHeight(16);
if (color > 9)
color = 9;
if (color < 0)
color = 0;
sprite.SetUVs((color + 4) * 2 * per_256, 30 * per_256, (color + 5) * 2 * per_256, 32 * per_256);
}
示例4: BigButterfly
public BigButterfly(TextureManager _t, int color)
{
this.color = color;
name = "BigButterfly";
Texture texture = _t.Get("etama1");
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(32);
sprite.SetHeight(32);
if (color > 7)
color = 7;
if (color < 0)
color = 0;
sprite.SetUVs(color * 4 * per_256, 22 * per_256, (color + 1) * 4 * per_256, 26 * per_256);
}
示例5: LittleJade
public LittleJade(TextureManager _t, int color)
{
this.color = color;
name = "LittleJade";
Texture texture = _t.Get("etama1");
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(32);
sprite.SetHeight(32);
if (color > 7)
color = 7;
if (color < 0)
color = 0;
sprite.SetUVs(color * 4 * per_256, 26 * per_256, (color + 1) * 4 * per_256, 30 * per_256);
}
示例6: FLowerBody
public FLowerBody(TextureManager _t,float w_h = 16)
{
Texture texture = _t.Get("Ef_etama2");
body = new Sprite();
body.Texture = texture;
body.SetWidth(w_h);
body.SetHeight(w_h);
body.SetUVs(2 * per_256, 12 * per_256, 4 * per_256, 14 * per_256);
body.SetColor(new Color(1, 1, 1, 1));
}
示例7: Rice_Double
public Rice_Double(TextureManager _t, int color)
{
this.color = color;
name = "Rice_Double";
Texture texture = _t.Get("etama1");
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(16);
sprite.SetHeight(16);
if (color > 15)
color = 15;
if (color < 0)
color = 0;
sprite.SetUVs(color * 2 * per_256, 2 * per_256, (color + 1) * 2 * per_256, 4 * per_256);
}
示例8: initiazeSprits
void initiazeSprits()
{
initPosition();
Sprits = new Dictionary<int, DoubleSprites>();
Texture tex = _texturemanager.Get("Title_01");
for (int i = 0; i < 9; i++)
{
Sprite spr1 = new Sprite();
Sprite spr2 = new Sprite();
spr1.Texture = tex;
spr2.Texture = tex;
if (i == _START_)
{
spr1.SetUVs(new Point(0, 0), new Point(0.3125f, 0.0625f));
spr2.SetUVs(new Point(0.3125f, 0), new Point(0.625f, 0.0625f));
spr1.SetWidth(160); spr1.SetHeight(32);
spr2.SetWidth(160); spr2.SetHeight(32);
}
else if (i == _RESULT__)
{
changeUnit(ref spr1, 0, 16, 22, 20, unit_for512);
changeUnit(ref spr2, 22, 16, 44, 20, unit_for512);
spr1.SetWidth(22*8); spr1.SetHeight(32);
spr2.SetWidth(22*8); spr2.SetHeight(32);
}
else if (i == _MUSIC_)
{
changeUnit(ref spr1, 0, 20, 22, 24, unit_for512);
changeUnit(ref spr2, 22, 20, 44, 24, unit_for512);
spr1.SetWidth(22 * 8); spr1.SetHeight(32);
spr2.SetWidth(22 * 8); spr2.SetHeight(32);
}
else if (i == _REPLY_)
{
changeUnit(ref spr1, 0, 12, 12, 16, unit_for512);
changeUnit(ref spr2, 12, 12, 24, 16, unit_for512);
spr1.SetWidth(12 * 8); spr1.SetHeight(32);
spr2.SetWidth(12 * 8); spr2.SetHeight(32);
}
else if (i == _OPTION_)
{
changeUnit(ref spr1, 0, 28, 14, 32, unit_for512);
changeUnit(ref spr2, 14, 28, 28, 32, unit_for512);
spr1.SetWidth(14 * 8); spr1.SetHeight(32);
spr2.SetWidth(14 * 8); spr2.SetHeight(32);
}
else if (i == _QUIT_)
{
changeUnit(ref spr1, 0, 32, 10, 36, unit_for512);
changeUnit(ref spr2, 10, 32, 20, 36, unit_for512);
spr1.SetWidth(10 * 8); spr1.SetHeight(32);
spr2.SetWidth(10 * 8); spr2.SetHeight(32);
}
spr1.SetPosition(Positions[i].X, Positions[i].Y);
spr2.SetPosition(Positions[i].X, Positions[i].Y);
Sprits.Add(i, new DoubleSprites(spr1, spr2));
}
}
示例9: Knife
public Knife(TextureManager _t, int color)
{
Texture texture = _t.Get("etama1");
name = "Knife";
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(32);
sprite.SetHeight(32);
if (color > 7)
color = 7;
if (color < 0)
color = 0;
sprite.SetUVs(color * 4 * per_256, 8 * per_256, (color + 1) * 4 * per_256, 12 * per_256);
this.color = color;
}
示例10: initializeSprite
void initializeSprite()
{
//基于front00.png的纹理载入,在这里舍弃
//NumCharactors = new Dictionary<string, Sprite>();
//Texture texture = texturemanager.Get("front00");
//NumCharactors = new Dictionary<string, Sprite>();
//Sprite sp;
//float _x = 0.5f+ 10*per_512;
//float _y = 5 * per_512;
//for (int i = 0; i < 10; i++)
//{
// sp = new Sprite();
// sp.Texture = texture;
// sp.SetWidth(charactorwidth);
// sp.SetHeight(charactorheight);
// sp.SetUVs(_x + i * 2 * per_512, _y,_x + (i+1)*2*per_512, _y + 2.5f * per_512);
// NumCharactors.Add(i.ToString(), sp);
//}
float per_256 = per_512 * 2;
Texture texture = texturemanager.Get("front00");
Texture texture2 = texturemanager.Get("front");
//HighScore
hiScoreSprite = new Sprite();
hiScoreSprite.Texture = texture2;
hiScoreSprite.SetWidth(64);
hiScoreSprite.SetHeight(16);
hiScoreSprite.SetUVs(0, 10 * per_256, 8 * per_256, 12 * per_256);
//Score
ScSp = new Sprite();
ScSp.Texture = texture2;
ScSp.SetWidth(64);
ScSp.SetHeight(16);
ScSp.SetUVs(0, 12 * per_256, 8 * per_256, 14 * per_256);
//Player
PlSp = new Sprite();
PlSp.Texture = texture2;
PlSp.SetWidth(64);
PlSp.SetHeight(16);
PlSp.SetUVs(0, 14 * per_256, 8 * per_256, 16 * per_256);
//helpstar
HelpStar = new Sprite();
HelpStar.Texture = texture2;
HelpStar.SetWidth(16);
HelpStar.SetHeight(16);
HelpStar.SetUVs(8 * per_256, 10 * per_256, 10 * per_256, 12 * per_256);
//Spell
SpellSp = new Sprite();
SpellSp.Texture = texture2;
SpellSp.SetWidth(64);
SpellSp.SetHeight(16);
SpellSp.SetUVs(0, 16 * per_256, 8 * per_256, 18 * per_256);
//spellstar
SpellStar = new Sprite();
SpellStar.Texture = texture2;
SpellStar.SetWidth(16);
SpellStar.SetHeight(16);
SpellStar.SetUVs(10 * per_256, 10 * per_256, 12 * per_256, 12 * per_256);
//Power
PowSp = new Sprite();
PowSp.Texture = texture2;
PowSp.SetWidth(64);
PowSp.SetHeight(16);
PowSp.SetUVs(0, 18 * per_256, 8 * per_256, 20 * per_256);
//Graze
GrazeSp = new Sprite();
GrazeSp.Texture = texture2;
GrazeSp.SetWidth(64);
GrazeSp.SetHeight(16);
GrazeSp.SetUVs(0, 20 * per_256, 8 * per_256, 22 * per_256);
//Point
PoSp = new Sprite();
PoSp.Texture = texture2;
PoSp.SetWidth(64);
PoSp.SetHeight(16);
PoSp.SetUVs(0, 22 * per_256, 8 * per_256, 24 * per_256);
//Tim
TimSp = new Sprite();
TimSp.Texture = texture2;
TimSp.SetWidth(64);
TimSp.SetHeight(16);
TimSp.SetUVs(0, 24 * per_256, 8 * per_256, 26 * per_256);
//RankLevel 难度选择(4 种难度 , 1种特殊关卡)
RankLevel = new Sprite[5];
for (int i = 0; i < 5; i++)
{
RankLevel[i] = new Sprite();
RankLevel[i].Texture = texture;
RankLevel[i].SetWidth(64);
RankLevel[i].SetHeight(16);
RankLevel[i].SetUVs(0.5f + 1 * per_512, 38 * per_512 + i * 2 * per_512,
0.5f + 9 * per_512, 40 * per_512 + i * 2 * per_512);
//.........这里部分代码省略.........
示例11: changeUnit
//将单位换算成百分比
void changeUnit(ref Sprite spr, int x, int y, int x2, int y2 , float eachpercent)
{
spr.SetUVs(new Point(x * eachpercent, y * eachpercent),
new Point(x2 * eachpercent, y2 * eachpercent));
}
示例12: changeUnit
//将单位换算成百分比
void changeUnit(ref Sprite spr, int x, int y, int x2, int y2)
{
spr.SetUVs(new Point(x * unit_for512, y * unit_for512),
new Point(x2 * unit_for512, y2 * unit_for512));
}
示例13: InvalidateSprites
void InvalidateSprites()
{
Sprite sp = new Sprite();
Texture texture = texturemanager.Get("st01logo");
sp.Texture = texture;
sp.SetWidth(13 * 8);
sp.SetHeight(2 * 8);
sp.SetUVs(29 * per_512, 4 * per_128, 42 * per_512, 6 * per_128);
MainSprites.Add("st01logo", sp);
sp = new Sprite();
sp.Texture = texturemanager.Get("st01logo");
sp.SetUVs(2 * per_512, 6 * per_128, 46 * per_512, 10 * per_128);
BackGround.Add("st01logo", sp);
}
示例14: Bonus_Font
public Bonus_Font(TextureManager _t)
{
texturemanager = _t;
Sprites = new Dictionary<string, Sprite>();
Sprite sprite;
Texture texture = _t.Get("fontex");
for (int i = 0; i < 10; i++)
{
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(i * per_256, 26 * per_256, (i + 1) * per_256, 28 * per_256);
Sprites.Add(i.ToString(), sprite);
}
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(10 * per_256, 26 * per_256, 11 * per_256, 28 * per_256);
Sprites.Add("%", sprite);
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(11 * per_256, 26 * per_256, 12 * per_256, 28 * per_256);
Sprites.Add(".", sprite);
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(12 * per_256, 26 * per_256, 13 * per_256, 28 * per_256);
Sprites.Add("-", sprite);
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(13 * per_256, 26 * per_256, 14 * per_256, 28 * per_256);
Sprites.Add("+", sprite);
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(14 * per_256, 26 * per_256, 15 * per_256, 28 * per_256);
Sprites.Add("(", sprite);
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(15 * per_256, 26 * per_256, 16 * per_256, 28 * per_256);
Sprites.Add(")", sprite);
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(8);
sprite.SetHeight(16);
sprite.SetUVs(17 * per_256, 24 * per_256, 18 * per_256, 26 * per_256);
Sprites.Add("/", sprite);
}
示例15: littleStar
public littleStar(TextureManager _t, int color)
{
name = "littleStar";
Texture texture = _t.Get("etama6");
sprite = new Sprite();
sprite.Texture = texture;
sprite.SetWidth(16);
sprite.SetHeight(16);
if (color > 15)
color = 15;
if (color < 0)
color = 0;
sprite.SetUVs(color * 2 * per_256, 0, (color + 1) * 2 * per_256, 2 * per_256);
this.color = color;
}