本文整理汇总了C#中PloobsEngine.ResyncStates方法的典型用法代码示例。如果您正苦于以下问题:C# PloobsEngine.ResyncStates方法的具体用法?C# PloobsEngine.ResyncStates怎么用?C# PloobsEngine.ResyncStates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PloobsEngine
的用法示例。
在下文中一共展示了PloobsEngine.ResyncStates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PosWithDepthDraw
protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, ref Microsoft.Xna.Framework.Matrix activeView, ref Microsoft.Xna.Framework.Matrix activeProjection)
{
Matrix viewIT = Matrix.Invert(Matrix.Transpose(activeView));
Vector3 position = new Vector3(viewIT.M14, viewIT.M24, viewIT.M34);
foreach (var item in Billboards)
{
if (item.Enabled)
{
SpriteFont font = item.SpriteFont == null ? SpriteFont : item.SpriteFont;
basicEffect.World = Matrix.CreateConstrainedBillboard(item.Position, position, Vector3.Down, null, null);
basicEffect.View = activeView;
basicEffect.Projection = activeProjection;
spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
Vector2 textOrigin = font.MeasureString(item.Message) / 2;
spriteBatch.DrawString(font, item.Message, Vector2.Zero, item.Color, 0, textOrigin, item.Scale, 0, 0);
spriteBatch.End();
}
}
render.ResyncStates();
}
示例2: Draw
protected override void Draw(GameTime gt, PloobsEngine.SceneControl.IObject obj, PloobsEngine.SceneControl.RenderHelper render, PloobsEngine.Cameras.ICamera cam, IList<PloobsEngine.Light.ILight> lights)
{
SpriteAnimated sprite = (obj as ISpriteObject).SpriteAnimated;
basicEffect.World = Matrix.CreateConstrainedBillboard(obj.PhysicObject.WorldMatrix.Translation, cam.Position, Vector3.Down, null, null);
basicEffect.View = cam.View;
basicEffect.Projection = cam.Projection;
Vector2 nscale = scale * new Vector2(1f/sprite.NumberAnimations, 1f/sprite.Frame);
spriteBatch.Begin(0, null, SamplerState.AnisotropicClamp, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
spriteBatch.Draw(sprite.Texture, Vector2.Zero, sprite.SourceRectangle, Color.White, sprite.Rotation, sprite.Origin, nscale, SpriteEffects.None, 1);
spriteBatch.End();
render.ResyncStates();
base.Draw(gt, obj, render, cam, lights);
}
示例3: PosWithDepthDraw
protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, Microsoft.Xna.Framework.Matrix activeView, Microsoft.Xna.Framework.Matrix activeProjection)
{
Matrix viewIT = Matrix.Invert(Matrix.Transpose(activeView));
Vector3 position = new Vector3(viewIT.M14, viewIT.M24, viewIT.M34);
foreach (var item in Billboards)
{
basicEffect.World = Matrix.CreateConstrainedBillboard(item.Position, position, Vector3.Up, null, null);
basicEffect.View = activeView;
basicEffect.Projection = activeProjection;
spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
spriteBatch.Draw(item.Texture, Vector2.Zero, item.Texture.Bounds, Color.White, 0, new Vector2(item.Texture.Bounds.Center.X, item.Texture.Bounds.Center.Y), item.Scale, SpriteEffects.None, 1);
spriteBatch.End();
}
render.ResyncStates();
}
示例4: PosWithDepthDraw
protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, ref Microsoft.Xna.Framework.Matrix activeView, ref Microsoft.Xna.Framework.Matrix activeProjection)
{
Matrix invertY = Matrix.CreateScale(1, -1, 1);
basicEffect.World = invertY;
basicEffect.View = Matrix.Identity;
basicEffect.Projection = activeProjection;
spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
foreach (var item in Billboards)
{
if (item.Enabled)
{
Vector3 viewSpaceTextPosition = Vector3.Transform(item.Position, activeView * invertY);
spriteBatch.Draw(item.Texture, new Vector2(viewSpaceTextPosition.X, viewSpaceTextPosition.Y), item.Texture.Bounds, Color.White, 0, new Vector2(item.Texture.Bounds.Center.X, item.Texture.Bounds.Center.Y), item.Scale, SpriteEffects.None, viewSpaceTextPosition.Z);
}
}
spriteBatch.End();
render.ResyncStates();
}
示例5: PosWithDepthDraw
protected override void PosWithDepthDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, ref Microsoft.Xna.Framework.Matrix activeView, ref Microsoft.Xna.Framework.Matrix activeProjection)
{
Matrix invertY = Matrix.CreateScale(1, -1, 1);
basicEffect.World = invertY;
basicEffect.View = Matrix.Identity;
basicEffect.Projection = activeProjection;
spriteBatch.Begin(0, null, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
foreach (var item in Billboards)
{
if (item.Enabled)
{
SpriteFont font = item.SpriteFont == null ? SpriteFont : item.SpriteFont;
Vector3 viewSpaceTextPosition = Vector3.Transform(item.Position, activeView * invertY);
Vector2 textOrigin = font.MeasureString(item.Message) / 2;
spriteBatch.DrawString(font, item.Message, new Vector2(viewSpaceTextPosition.X, viewSpaceTextPosition.Y), item.Color, 0, textOrigin, item.Scale, 0, viewSpaceTextPosition.Z);
}
}
spriteBatch.End();
render.ResyncStates();
}