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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zsbzsb

Pages: 1 2 [3] 4 5 ... 94
31
DotNet / Re: Text input C#
« on: January 06, 2016, 02:11:42 pm »
There is no way for me to know that, since it is a logic error in your code that is something you must figure out. If you have never used the debugger now is the perfect time to learn.  ;)

32
General / Re: Can't get sprite to move in angle
« on: January 06, 2016, 12:31:17 am »
Its not very clear what you want. Generally around here we are happy to help with specific problems, but when you just post a snippet of your code and ask us to debug it chances are good you won't get any replies.

Honestly, since this is a logical error in your code it is something you should debug yourself. And if you don't know how to use a debugger then this would be a perfect time for you to learn.

33
DotNet / Re: Text input C#
« on: January 05, 2016, 02:58:46 pm »
Quote
Not working

Not working how? You need to be specific. Post a complete and minimal example (don't just upload your code and ask us to find the issue). The TextEntered event is what you need to use for text input.

34
Graphics / Re: Sprite is drawn twice
« on: January 04, 2016, 02:43:49 pm »
Do your construct your button sprites with a different texture in the constructor? If so you need to call setTexture(...) with the second parameter as true. What it looks like to me is that the sprite's texture rects are a different size of from the actual texture size. However, without a complete and minimal example we really can't help much except by guessing.

35
DotNet / Re: Text input C#
« on: January 04, 2016, 02:35:13 pm »
Use the TextEntered event for text input. The KeyEventArgs.code is an enum for keys that only correspond to internal values (not any standards such as ANSI or Unicode).

36
(... and uses modern C++)

This is why I asked about the source code, because if you look at the cover (I know you shouldn't judge a book by it's cover) you will see the following line of code blended into the background...

sf::Texture* texture = new sf::Texture();

37
DotNet / Re: Sprite.Transform.TransformRect()
« on: January 02, 2016, 07:11:17 pm »
Maybe I am just getting old but it seems that properties like Size should be for configuration at start up and properties/methods of Scale are for runtime/render-loop alteration.  Basically, this is purely semantics.

Its not my call, but it was removed in SFML 2 (was available in SFML 1) in favor of just the scale value. This was because the idea behind SFML is to not provide every single possible helper function, but to keep a minimal API that users can easily build off of. It has been discussed (feel free to search), but I really doubt an absolute size value is coming back.

Quote
Sorry to bother you.

There is no need to apologize, if I didn't want to help I wouldn't have bothered responding.  ;)

38
DotNet / Re: Sprite.Transform.TransformRect()
« on: January 02, 2016, 05:09:51 pm »
Quote
Why doesn't the Sprite class simply have access to a Size member where we can set it's size with a method or a Size Property that we can set a Size on? 

It will as soon as it gets added back into the C++ side of things (which won't happen).

Quote
Lacking documentation...

The docs are not lacking, everything is fully documented.

Quote
...it appears that the purpose of TransformRect() is to change the size of the sprite

TransformRect(...) is a member of the Tranform class. I don't see why you would think this would change the size of a sprite. It is clearly documented as what it does. When it comes to using an API, don't assume stuff - read the docs, they weren't written to be ignored.

Quote
This is not very intuitive and seems like something that would be taken care of by the Scale property

The Scale property will change the size of the sprite by adjusting the transform. To calculate the scale (in order to achieve a specific size) simply divide the desired size by the texture size.

sprite.Scale = desiredSize / (Vector2f)sprite.Texture.Size;

Quote
I think I'm going to switch back to c++

The C++ side of SFML has the same API, so that really won't change anything.

39
General discussions / Re: SFML Game Development by Example - 4th SFML book
« on: December 29, 2015, 11:23:29 pm »
Is the source code available on github as with some of the other SFML books?

40
Window / Re: sf::Joystick DualShock3 Sixaxis Analogue Triggers
« on: December 29, 2015, 09:38:23 pm »
SFML simply reports what it gets from the OS regarding button(s)/axis(s). I wouldn't be surprised if your R2/L2 are reported as one of the buttons.

41
Window / Re: Change mouse icon
« on: December 26, 2015, 09:52:32 pm »
See also PR #827.

42
Post a complete and minimal example that shows the problem. But if I had to guess, I would say that your font and text instance are part of your WindowButton class and you copy your button which causes the font to be copied, but the text instance still has a pointer to the old font.

43
Window / Re: Bug Report window not responding
« on: December 21, 2015, 05:30:52 am »
https://github.com/SFML/SFML/pull/947

Make sure you are using SFML 2.3.2 or the latest master (which you should use for bug testing).

44
Graphics / Re: how to render line with SFML?
« on: December 03, 2015, 03:11:36 am »
Draw a rotated RectangleShape.

45
DotNet / Re: KeyPressed Event Not Firing When Expected (SFML.NET 2.2)
« on: November 30, 2015, 02:03:26 am »
Disable the key repeat.
GameWindow.SetKeyRepeatEnabled(false);

Pages: 1 2 [3] 4 5 ... 94