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 - thoniel

Pages: [1] 2
1
Graphics / rotating and THEN scaling sprite
« on: August 01, 2009, 10:03:26 pm »
hi
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?

2
DotNet / postfx parameter not found
« on: August 01, 2009, 03:27:18 pm »
hi
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.

3
SFML projects / [WIP] Space Invaders: Global Invasion
« on: July 30, 2009, 03:46:39 pm »
interesting idea, im looking forward to play it ;)

4
Graphics / Two small graphics problems.
« on: July 29, 2009, 05:42:46 pm »
well, between each of your tiles of the image is a white line. i guess thats your problem xD

to fix that, you need to place the subrect of the sprite not +width but +width+1 or something

5
DotNet / AccessViolationException when changing properties
« on: July 29, 2009, 05:37:47 pm »
sorry for my 3rd post but that didnt help.

- i downloaded the trunk
- compiled sfml
- compiled csfml
- imported the .net projects of sfml into my project and replaced csfml* with my newly build files.

then i deleted every build of my project
end rebuild, also putting the new csfml files into the build folder.

sadly, the problem remains.

btw. what is cfsml for anyway? why dont you use your c++ lib directly?
sorry if thats a dump question, i have very small knowledge about c/c++

6
DotNet / AccessViolationException when changing properties
« on: July 29, 2009, 04:04:04 pm »
embedded SFML.net, sadly that did not help. it breaks @

Code: [Select]
           public string Text
            {
                // TODO : use unicode functions
                // (convert from UTF-16 to UTF-32, and find how to marshal System.String as sfUint32*...)
                get {return sfString_GetText(This);} // <<<< here
                set {sfString_SetText(This, value);}
            }


i will try to compile the rest

7
DotNet / AccessViolationException when changing properties
« on: July 29, 2009, 02:36:29 pm »
thats a good idea, i will try later

8
DotNet / AccessViolationException when changing properties
« on: July 29, 2009, 01:25:48 pm »
hi
Code: [Select]
A first chance exception of type 'System.AccessViolationException' occurred in sfmlnet-graphics.dll

it comes out of your dll so maybe its not compatible with win7... i dont know. if you have some time and access to windows 7 you might try to reproduce the error.

for now i catch the exception and it works but its kinda strange.

9
DotNet / sfml in widget (qt or whatever)
« on: July 23, 2009, 01:16:08 pm »
thanks. you are right. (should work with qt as well. i will try)

Windows Form
Code: [Select]
public partial class Form1 : Form
{
UnitTestMitForm game;
public Form1() {
InitializeComponent();

game = new UnitTestMitForm(this.Handle);
game.Run();
}

public void RenderFrame() {
game.RenderFrame();
}
}


Game.RenderFrame()

Code: [Select]
public void RenderFrame() {
float deltaTime = window.GetFrameTime();

// Events feuern
window.DispatchEvents();

// spiel aktualisieren
Update(deltaTime);

// spiel malen
window.Clear();
Draw(gameDrawer, deltaTime);
window.Display();
}


Program
Code: [Select]
Form1 form = new Form1();

form.Show();

while(form.Created) {
form.RenderFrame();
Application.DoEvents();
}


seems to work. i will try to use it and i will see if there is something wrong i cant see right now.

10
DotNet / sfml in widget (qt or whatever)
« on: July 23, 2009, 12:09:55 am »
hi
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.

11
Graphics / defaultfont charactersize
« on: July 20, 2009, 10:05:46 am »
well yeah. would have been great if it was avoidable. but i will try in the future to embed the font into the resources.

thanks

12
Graphics / defaultfont charactersize
« on: July 19, 2009, 10:43:29 pm »
sure but that way i need to deliver a font with the dll and i dont like to have external dependencies where i have no control (room for human errors)

but it seems i have no choice. thanks

13
Graphics / defaultfont charactersize
« on: July 19, 2009, 10:16:27 pm »
hi
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.

14
DotNet / AccessViolationException when changing properties
« on: July 17, 2009, 10:51:15 am »
im using windows 7 and visual studio 2010.

i tried to build on;

.Net 2.0 - CRASH
.Net 3.0 - CRASH
.Net 3.5 - CRASH
.Net 4.0 - works fine
mono 2.4 - CRASH (this is what i work on)

i will try on my laptop with winXP if it behaves differently

////
on winxp it works fine (just crashes when closing, but thats a different problem). i guess this is a windows 7 - .net framework related problem

15
DotNet / AccessViolationException when changing properties
« on: July 17, 2009, 10:17:00 am »
i hope this works for you (i added a fps counter to see when it crashes)

it has to do with changing the text within events.
the events are not running in seperate threads arent they?

Code: [Select]
using System;

namespace SFMLTest
{
    public class Blub
    {
        SFML.Graphics.RenderWindow window;
        SFML.Graphics.String2D stringObject;
        SFML.Graphics.String2D fps;
        //string content = "";
        public void Run()
        {
            window = new SFML.Graphics.RenderWindow(new SFML.Window.VideoMode(800, 600), "test");
            window.Closed += new EventHandler(OnClose);
            window.TextEntered += new EventHandler<SFML.Window.TextEventArgs>(OnTextEntered);
            window.SetFramerateLimit(60);

            stringObject = new SFML.Graphics.String2D("text");
            stringObject.Position = new SFML.Graphics.Vector2(10, 100);
            fps = new SFML.Graphics.String2D("0");
            fps.Position = new SFML.Graphics.Vector2(500, 10);

            while (window.IsOpened())
            {
                float deltaTime = window.GetFrameTime();

                window.DispatchEvents();

                Update();

                window.Clear();
                Draw();
                window.Display();
            }
        }

        private void Update()
        {
            fps.Text = "" + (1f / window.GetFrameTime());
            //stringObject.Text = content;
        }

        private void Draw()
        {
            window.Draw(stringObject);
            window.Draw(fps);
        }

        private void OnTextEntered(object sender, SFML.Window.TextEventArgs args)
        {
            if (args.Unicode.ToCharArray()[0] > 31)
            {
                //content += args.Unicode;
                stringObject.Text += args.Unicode;
            }
        }

        private void OnClose(object sender, EventArgs e)
        {
            window.Close();
        }
    }
}


it breaks in OnTextEntered when typing very fast.

when im using a seperate string to modify and then assign it in update to the string2d (commented out), it works just fine.

Pages: [1] 2