Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Solved]Someone suffering with views...  (Read 3874 times)

0 Members and 1 Guest are viewing this topic.

NinjaFighter

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://www.sebagames.wordpress.com
[Solved]Someone suffering with views...
« on: April 13, 2011, 08:10:49 am »
Sorry for this question, but I'm trying to figure how to port my xna fighting game engine, and I'm suffering with some view issues.
Someone knows if that's possible to do this? :(


The blue shape represents the shadow I want to make, it's composite by 2 sprites: The girl and the katana. But I can't scale the sprite group to make the shadow. (anyway, I can't flip too!, but whatever, there are an easy way to flip horizontally, because there's no scale. But for example, the katana is rotated... so, there are a lot of problems to do that. )

I've create my own software to create animations and bind objects to characters, but now, I can't scale a group of sprites from the SPRITE center point. I need find a way to do this... I currently try to change the view size, but I can't do because I don't figure how to scale from the character's axis.  :(

I'm using all my freetime to port my fighting engine from Xna, but, really I don't want to have to use Tao.OpenGl and create my own renderer only for this very simple limitation. If there are a way to do what I want (no matter if it's a complicated way), please, tell me how can I do.
« Last Edit: May 22, 2012, 09:30:47 pm by NinjaFighter »

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: Someone suffering with views...
« Reply #1 on: April 13, 2011, 09:21:27 am »
Quote from: "NinjaFighter"
The blue shape represents the shadow I want to make, it's composite by 2 sprites: The girl and the katana. But I can't scale the sprite group to make the shadow. (anyway, I can't flip too!, but whatever, there are an easy way to flip horizontally, because there's no scale. But for example, the katana is rotated... so, there are a lot of problems to do that. )

Shouldn't this be done with sprites? http://www.sfml-dev.org/documentation/2.0/classsf_1_1Sprite.htm#a5edd7f661b2b45c29a13abec47efae15

Quote from: "NinjaFighter"
I currently try to change the view size, but I can't do because I don't figure how to scale from the character's axis.  :(

Are you still talking about the sprite or am I misinterpreting something? Anyway:
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Drawable.htm#a0ca6c6cd466339f439f0439e1a61f576
http://www.sfml-dev.org/documentation/2.0/classsf_1_1View.htm#aff9946d4821b7bf8abd8a41f33bd0e10

This is the documentation for C++ but it shouldn't be far from the .NET bindings.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

NinjaFighter

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://www.sebagames.wordpress.com
Someone suffering with views...
« Reply #2 on: April 13, 2011, 05:18:08 pm »
If I've only one sprite, it's ok, because I can flip it and transform simply modifying the sprites attributes. The .net api is like the c++ one for this aspects.

But my problem is because I try to scale o GROUP of sprites. You can see the katana's sprite, this is a rotated one, so that means the original image wasn't rotated. So, I need to figure how to scale, matrix or view or whatever, but I need to scale at a specifics point (not at screen's center point) and I can't do it. :(

NinjaFighter

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
    • http://www.sebagames.wordpress.com
Re: Someone suffering with views...
« Reply #3 on: May 05, 2012, 07:13:02 am »
Finally! The new Sfml2 RC is capable to do this! =D (using RenderStates with Transforms) Thanks a lot Laurent! =D
Only one question...
To "isometrise" a simple square... I must do a transformation in this order:
Transform t = Transform.Identity;
t.Scale(1f,0.5f);
t.Rotate(45f);

but... maybe the intuitive way must be:
Transform t = Transform.Identity;
t.Rotate(45f);
t.Scale(1f,0.5f);

What do you think?

Edit:
I realized that is the way for opengl matrices. I came from xna, that uses the other order. Sorry for my ignorance.  :-X
« Last Edit: May 11, 2012, 07:54:04 am by NinjaFighter »