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.

Topics - thoniel

Pages: [1]
Graphics / rotating and THEN scaling sprite
« on: August 01, 2009, 10:03:26 pm »
i wanted to rotate a sprite by 45 degrees and then scale it down in the height to get a isometric-sort-of tile.

but if i do that directly by sprite.rotate and sprite.scale, it seems that it order is always scale and then rotate. (which sort of makes sense).

is there any possibility how i can modify directly an image or something like this to get what i need?

DotNet / postfx parameter not found
« on: August 01, 2009, 03:27:18 pm »
wouldnt it be better, to throw an exception if a paremeter is not found?

probably there are problems i am not aware of but maybe you could look into this.

DotNet / sfml in widget (qt or whatever)
« on: July 23, 2009, 12:09:55 am »
is there a good way to use sfml in qt or smiliar as a widget?

i saw a way for c++ in the wiki, but c# does not support multiple inheritance as c++ does.

Graphics / defaultfont charactersize
« on: July 19, 2009, 10:16:27 pm »
is there any chance to change the character size of the default font (using dotnet)?

im writing a very simple gui and i dont want to have to load a font from file if not neccessary, but the default font provided by sfml is way to big.

DotNet / AccessViolationException when changing properties
« on: July 17, 2009, 01:36:44 am »
hi there,
ive got a silly problem.

im writing a textbox right now and ive encountered several errors with String2d.

when i change and read properties like Text several times before drawing (often initiated through events) i get the AccessViolationException.

Code: [Select]
System.AccessViolationException was unhandled
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
       at SFML.Graphics.String2D.sfString_GetText(IntPtr This)
       at SFML.Graphics.String2D.get_Text()

am i doing something wrong or is this a bug? how can i avoid this?

(the last days i avoided this by changing text just before drawing, but now i need to change it several times as i try to measure the width of the string)

this is the code:

Code: [Select]
       public int Width
                string oldText = Text;
                if (oldText.Length == 0)
                    return 0;

                float start = drawable.GetCharacterPos(0).X;
                Text = oldText + "|";
                float end = drawable.GetCharacterPos((uint)oldText.Length).X;

                Text = oldText;
                return (int)(end - start);

Window / KeyEventArgs.Alt / Control / Shift
« on: July 14, 2009, 04:54:41 pm »
im using sfml 1.5 with c# and trying to wrap parts of sfml so have it easy to modifiy things.

right now, im wrapping Input in my own input class. and by that i recognized that KeyEventArgs.Alt etc. do not seem to work.

i have a method that listens to KeyPressed for example. but when i press Alt and A,first Alt and then A events are fired (in the keycodes, the booleans are never true).

is that right?


Graphics / does it makes sense to have a lot sprites of the same image?
« on: September 30, 2008, 08:49:22 pm »
im trying to do a tilemap right now and i have a lot sprites of the same image to cover the floor.
im used to draw the same image over and over again on different positions.

does it make sense to have for each groundtile one sprite, or should i make one sprite and then draw it. change position, draw it again etc.

i guess visually it would come out the same but in termes of memory the first one may be inefficient.

what do you say?


Code: [Select]
void MapLayer::Draw(const sf::RenderWindow &window)
for(int y=0; y<5; y++) {
for(int x=0; x<4; x++) {
if (grid.at(y).at(x) == 0) {

Pages: [1]