本文整理匯總了C#中Microsoft.Xna.Framework.Graphics.Texture2D.GetTexcoordsFromPixelCoords方法的典型用法代碼示例。如果您正苦於以下問題:C# Texture2D.GetTexcoordsFromPixelCoords方法的具體用法?C# Texture2D.GetTexcoordsFromPixelCoords怎麽用?C# Texture2D.GetTexcoordsFromPixelCoords使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.Xna.Framework.Graphics.Texture2D
的用法示例。
在下文中一共展示了Texture2D.GetTexcoordsFromPixelCoords方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FigureMovementAnimationComponent
public FigureMovementAnimationComponent(Entity referringEntity, Texture2D texture) : base(referringEntity)
{
var forward = Animation.CreateDiscrete(0.65f, new[]
{
texture.GetTexcoordsFromPixelCoords(0, 0),
texture.GetTexcoordsFromPixelCoords(32, 0),
texture.GetTexcoordsFromPixelCoords(0, 0),
texture.GetTexcoordsFromPixelCoords(64, 0),
}, OnUpdate, true);
var left = Animation.CreateDiscrete(0.65f, new[]
{
texture.GetTexcoordsFromPixelCoords(0, 32),
texture.GetTexcoordsFromPixelCoords(32, 32),
texture.GetTexcoordsFromPixelCoords(0, 32),
texture.GetTexcoordsFromPixelCoords(64, 32),
}, OnUpdate, true);
var right = Animation.CreateDiscrete(0.65f, new[]
{
texture.GetTexcoordsFromPixelCoords(0, 96),
texture.GetTexcoordsFromPixelCoords(32, 96),
texture.GetTexcoordsFromPixelCoords(0, 96),
texture.GetTexcoordsFromPixelCoords(64, 96),
}, OnUpdate, true);
var backward = Animation.CreateDiscrete(0.65f, new[]
{
texture.GetTexcoordsFromPixelCoords(0, 64),
texture.GetTexcoordsFromPixelCoords(32, 64),
texture.GetTexcoordsFromPixelCoords(0, 64),
texture.GetTexcoordsFromPixelCoords(64, 64),
}, OnUpdate, true);
AddAnimation(ForwardAnimation, forward);
AddAnimation(BackwardAnimation, backward ?? forward);
AddAnimation(LeftAnimation, left ?? forward);
AddAnimation(RightAnimation, right ?? forward);
}