本文整理汇总了C#中UltimaXNA.Core.Graphics.SpriteBatchUI类的典型用法代码示例。如果您正苦于以下问题:C# SpriteBatchUI类的具体用法?C# SpriteBatchUI怎么用?C# SpriteBatchUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpriteBatchUI类属于UltimaXNA.Core.Graphics命名空间,在下文中一共展示了SpriteBatchUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
Vector3 hueVector = Utility.GetHueVector(Hue);
int width = (int)(m_PercentWidthDrawn * Width);
spriteBatch.Draw2D(m_Texture, new Rectangle(position.X, position.Y, width, Height), new Rectangle(0, 0, width, Height), hueVector);
base.Draw(spriteBatch, position);
}
示例2: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
bool isMouseOver = (m_BG[0].IsMouseOver || m_BG[1].IsMouseOver || m_BG[2].IsMouseOver);
if (m_IsMouseDown)
{
m_BG[0].IsVisible = false;
m_BG[1].IsVisible = false;
m_BG[2].IsVisible = true;
}
else if (isMouseOver)
{
m_BG[0].IsVisible = false;
m_BG[1].IsVisible = true;
m_BG[2].IsVisible = false;
}
else
{
m_BG[0].IsVisible = true;
m_BG[1].IsVisible = false;
m_BG[2].IsVisible = false;
}
if (m_IsMouseDown)
m_Caption.Position = new Point(m_Caption.Position.X, m_Caption.Position.Y + 1);
base.Draw(spriteBatch, position);
if (m_IsMouseDown)
m_Caption.Position = new Point(m_Caption.Position.X, m_Caption.Position.Y - 1);
}
示例3: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
AEntity player = WorldModel.Entities.GetPlayerEntity();
float x = (float)Math.Round((player.Position.X % 256) + player.Position.X_offset) / 256f;
float y = (float)Math.Round((player.Position.Y % 256) + player.Position.Y_offset) / 256f;
Vector3 playerPosition = new Vector3(x - y, x + y, 0f);
float minimapU = (m_GumpTexture.Width / 256f) / 2f;
float minimapV = (m_GumpTexture.Height / 256f) / 2f;
VertexPositionNormalTextureHue[] v = new VertexPositionNormalTextureHue[4]
{
new VertexPositionNormalTextureHue(new Vector3(position.X, position.Y, 0), playerPosition + new Vector3(-minimapU, -minimapV, 0), new Vector3(0, 0, 0)),
new VertexPositionNormalTextureHue(new Vector3(position.X + Width, position.Y, 0), playerPosition + new Vector3(minimapU, -minimapV, 0), new Vector3(1, 0, 0)),
new VertexPositionNormalTextureHue(new Vector3(position.X, position.Y + Height, 0), playerPosition + new Vector3(-minimapU, minimapV, 0), new Vector3(0, 1, 0)),
new VertexPositionNormalTextureHue(new Vector3(position.X + Width, position.Y + Height, 0), playerPosition + new Vector3(minimapU, minimapV, 0), new Vector3(1, 1, 0))
};
spriteBatch.Draw(m_GumpTexture, v, Techniques.MiniMap);
if (UltimaGame.TotalMS % 500f < 250f)
{
if (m_PlayerIndicator == null)
{
m_PlayerIndicator = new Texture2D(spriteBatch.GraphicsDevice, 1, 1);
m_PlayerIndicator.SetData<uint>(new uint[1] { 0xFFFFFFFF });
}
spriteBatch.Draw2D(m_PlayerIndicator, new Vector3(position.X + Width / 2, position.Y + Height / 2 - 8, 0), Vector3.Zero);
}
}
示例4: Draw
public void Draw(SpriteBatchUI spriteBatch, int x, int y)
{
// determine if properties need to be updated.
if (m_Entity != null && m_PropertyListHash != m_Entity.PropertyList.Hash)
{
m_PropertyListHash = m_Entity.PropertyList.Hash;
Caption = m_Entity.PropertyList.Properties;
}
// update text if necessary.
if (m_RenderedText == null)
{
m_RenderedText = new RenderedText("<center>" + Caption, 300, true);
}
else if (m_RenderedText.Text != "<center>" + Caption)
{
m_RenderedText = null;
m_RenderedText = new RenderedText("<center>" + Caption, 300, true);
}
// draw checkered trans underneath.
spriteBatch.Draw2DTiled(CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero);
// draw tooltip contents
m_RenderedText.Draw(spriteBatch, new Point(x, y));
}
示例5: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
if (m_Texture == null)
{
IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
if (IsFemale)
{
int index = Item.ItemData.AnimID + 60000;
int indexTranslated, hueTranslated;
if (GumpDefTranslator.ItemHasGumpTranslation(index, out indexTranslated, out hueTranslated))
{
index = indexTranslated;
m_HueOverride = hueTranslated;
m_Texture = provider.GetUITexture(index);
}
}
if (m_Texture == null)
{
int index = Item.ItemData.AnimID + 50000;
int indexTranslated, hueTranslated;
if (GumpDefTranslator.ItemHasGumpTranslation(index, out indexTranslated, out hueTranslated))
{
index = indexTranslated;
m_HueOverride = hueTranslated;
m_Texture = provider.GetUITexture(index);
}
m_Texture = provider.GetUITexture(index);
}
Size = new Point(m_Texture.Width, m_Texture.Height);
}
int hue = (Item.Hue == 0 & m_HueOverride != 0) ? m_HueOverride : Item.Hue;
spriteBatch.Draw2D(m_Texture, new Vector3(position.X, position.Y, 0), Utility.GetHueVector(hue));
base.Draw(spriteBatch, position);
}
示例6: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
Texture2D worldTexture = (m_Model.GetView() as WorldView).Isometric.Texture;
m_InputMultiplier = new Vector2((float)worldTexture.Width / Width, (float)worldTexture.Height / Height);
spriteBatch.Draw2D(worldTexture, new Rectangle(position.X, position.Y, Width, Height), Vector3.Zero);
base.Draw(spriteBatch, position);
}
示例7: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position, double frameMS)
{
base.Draw(spriteBatch, position, frameMS);
if (Caption != string.Empty) {
int yoffset = IsMouseDownOnThis ? 2 : 1;
m_Caption.Draw(spriteBatch, new Point(
position.X + (Width - m_Caption.Width) / 2,
position.Y + yoffset + (Height - m_Caption.Height) / 2));
}
}
示例8: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
int y = m_TextEntry.Y + position.Y - 6;
for (int i = m_TextEntries.Count - 1; i >= 0; i--)
{
y -= m_TextEntries[i].TextHeight;
m_TextEntries[i].Draw(spriteBatch, new Point(position.X + 2, y));
}
base.Draw(spriteBatch, position);
}
示例9: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
base.Draw(spriteBatch, position);
if (IsChecked && m_Active != null)
{
spriteBatch.Draw2D(m_Active, new Vector3(position.X, position.Y, 0), Vector3.Zero);
}
else if (!IsChecked && m_Inactive != null)
{
spriteBatch.Draw2D(m_Inactive, new Vector3(position.X, position.Y, 0), Vector3.Zero);
}
}
示例10: Initialize
public void Initialize()
{
m_SpriteBatch = Service.Get<SpriteBatchUI>();
Texture = new Texture2D(m_SpriteBatch.GraphicsDevice, (int)Stride, (int)Stride);
m_TextureData = new uint[Stride * Stride];
m_BlockColors = new uint[TilesPerBlock];
m_BlockCache = new MiniMapChunk[BlockCacheWidth * BlockCacheHeight];
m_MustRedrawEntireTexture = true;
m_QueuedToDrawBlocks = new List<uint>();
}
示例11: Draw
public void Draw(SpriteBatchUI spriteBatch, int x, int y)
{
// draw checkered trans underneath.
if (m_RenderedText == null)
{
m_RenderedText = new RenderedText(Caption, 200);
}
spriteBatch.Draw2DTiled(Controls.CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero);
m_RenderedText.Draw(spriteBatch, new Point(x, y));
}
示例12: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
if (m_texture == null)
{
if (IsFemale)
m_texture = IO.GumpData.GetGumpXNA(Item.ItemData.AnimID + 60000);
if (m_texture == null)
m_texture = IO.GumpData.GetGumpXNA(Item.ItemData.AnimID + 50000);
Size = new Point(m_texture.Width, m_texture.Height);
}
spriteBatch.Draw2D(m_texture, new Vector3(position.X, position.Y, 0), Utility.GetHueVector(Item.Hue));
base.Draw(spriteBatch, position);
}
示例13: BeforeDraw
protected virtual void BeforeDraw(SpriteBatchUI spritebatch, Point position)
{
// Over the interface or not in world. Display a default cursor.
int artworkIndex = 8305;
if (WorldModel.IsInWorld && WorldModel.Entities.GetPlayerEntity().Flags.IsWarMode)
{
// if in warmode, show the red-hued cursor.
artworkIndex -= 23;
}
CursorSpriteArtIndex = artworkIndex;
CursorOffset = new Point(-1, 1);
}
示例14: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
if (m_texture == null)
{
m_texture = IO.ArtData.GetStaticTexture(Item.DisplayItemID);
Size = new Point(m_texture.Width, m_texture.Height);
}
Vector3 hue = Utility.GetHueVector(IsMouseOver && HighlightOnMouseOver ? WorldView.MouseOverHue : Item.Hue);
if (Item.Amount > 1 && Item.ItemData.IsGeneric)
{
int offset = Item.ItemData.Unknown4;
spriteBatch.Draw2D(m_texture, new Vector3(position.X - offset, position.Y - offset, 0), hue);
}
spriteBatch.Draw2D(m_texture, new Vector3(position.X, position.Y, 0), hue);
base.Draw(spriteBatch, position);
}
示例15: Draw
public override void Draw(SpriteBatchUI spriteBatch, Point position)
{
if (m_Texture == null)
{
IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
m_Texture = provider.GetItemTexture(Item.DisplayItemID);
Size = new Point(m_Texture.Width, m_Texture.Height);
}
Vector3 hue = Utility.GetHueVector(IsMouseOver && HighlightOnMouseOver ? WorldView.MouseOverHue : Item.Hue);
if (Item.Amount > 1 && Item.ItemData.IsGeneric && Item.DisplayItemID == Item.ItemID)
{
int offset = Item.ItemData.Unknown4;
spriteBatch.Draw2D(m_Texture, new Vector3(position.X - 5, position.Y - 5, 0), hue);
}
spriteBatch.Draw2D(m_Texture, new Vector3(position.X, position.Y, 0), hue);
base.Draw(spriteBatch, position);
}