Delta Engine
»
Support
»
Rendering
»
Reflect a Material2D
Joined: 8/21/2011(UTC) Posts: 37
Was thanked: 1 time(s) in 1 post(s)
|
In XNA I can reflect a Sprite with the "SpriteEffects". And in the DE?
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Originally Posted by: CARUFO  In XNA I can reflect a Sprite with the "SpriteEffects". And in the DE? What does "reflect a sprite" mean? Do you mean flipping it? You can rotate it or pass custom points to it rotating or flipping it. There is also a switch in MaterialManager for flipping materials (needed for render to texture).
|
|
|
|
Joined: 8/21/2011(UTC) Posts: 37
Was thanked: 1 time(s) in 1 post(s)
|
Yes, flipping I mean. Quote:There is also a switch in MaterialManager for flipping materials (needed for render to texture). I don't understand.
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
I don't have a sample at hand, but we will add something for the next release to explain what options are available.
|
|
|
|
Joined: 8/21/2011(UTC) Posts: 37
Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
Medals:  Joined: 8/20/2011(UTC) Posts: 1,421 Location: Hannover
Thanks: 18 times Was thanked: 97 time(s) in 92 post(s)
|
Btw, this was implemented in v0.9.1, here is the unit test on how to do it: Code:
#region DrawMaterialFlipped
/// <summary>
/// This test explains how to draw materials vertically or horizontally
/// flipped. Internally the UVs are flipped, nothing else changes. You can
/// combine this with other operations like rotation or coloring as well.
/// </summary>
[Test]
public static void DrawMaterialFlipped()
{
Material2DColored logo = new Material2DColored("DeltaEngineLogo");
Application.Start(delegate
{
logo.Draw(Rectangle.FromCenter(
Point.Half + new Size(-0.5f, -0.5f) * logo.Size, logo.Size), 0,
FlipMode.None);
logo.Draw(Rectangle.FromCenter(
Point.Half + new Size(0.5f, -0.5f) * logo.Size, logo.Size), 0,
FlipMode.Horizontal);
logo.Draw(Rectangle.FromCenter(
Point.Half + new Size(-0.5f, 0.5f) * logo.Size, logo.Size), 0,
FlipMode.Vertical);
logo.Draw(Rectangle.FromCenter(
Point.Half + new Size(0.5f, 0.5f) * logo.Size, logo.Size), 0,
FlipMode.VerticalAndHorizontal);
});
}
#endregion
|
|
|
|
Delta Engine
»
Support
»
Rendering
»
Reflect a Material2D
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.