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

Pages: 1 [2]
DotNet / Sprites become flat squares when renderWindow is re-created
« on: June 07, 2010, 08:44:41 am »
I'm using SFML with Mono. I have the PC build working fine, and now I'm porting it over to Linux.  I'm really loving SFML's ease of use - I'm definitely looking toward to continuing using it for future projects.

I noticed a quirk in the Linux build.  I'm not sure if it's SFML or Mono or something else, but I'd like to float it here to see if anyone has seen this before.

Here is how the screen initially looks:

After I change resolution or switch to fullscreen, this happens:

It seems to be triggered whenever I re-create the RenderWindow:
Code: [Select]

this.app = new RenderWindow(new VideoMode(optionsData.VideoWidth, (uint)optionsData.VideoHeight, 32), Resource.MenuTitle, windowStyle);

I'm using SFML v1.6 for everything except the graphics component (v1.5 for the graphics).  I'm running on 64-bit Windows7, with Ubuntu 10.04 on VirtualBox.

DotNet / [SOLVED] Toggling fullscreen / resolution changing
« on: May 06, 2010, 07:43:11 pm »
I'm having trouble with the syntax for toggling fullscreen and changing resolutions.

It seems in the C implementation of SFML, you would call: App.Create(...), but I can't find the equivalent call in the Dotnet implementation.

Here's my attempt at it, though all it does is create a separate empty  fullscreen window that doesn't receive any input. Any help would be appreciated!

Code: [Select]

using System;
using SFML;
using SFML.Window;
using SFML.Graphics;

namespace WindowTest
    public class Game1
        static void Main()
            RenderWindow App = new RenderWindow(new VideoMode(640, 480, 32), "Window test");

            App.Closed += new EventHandler(OnClosed);
            App.KeyPressed += new EventHandler<SFML.Window.KeyEventArgs>(OnKeyPressed);

            while (App.IsOpened())

        static void OnClosed(object sender, EventArgs e)
            RenderWindow window = (RenderWindow)sender;

        static void OnKeyPressed(object sender, SFML.Window.KeyEventArgs e)
            RenderWindow window = (RenderWindow)sender;
            if (e.Code == KeyCode.Return)
                //go to fullscreen.
                window = new RenderWindow(new VideoMode(1024, 768, 32),
                    "New Title", Styles.Fullscreen);
            if (e.Code == KeyCode.Escape)

Graphics / Different sprite width/height behavior in 1.6?
« on: April 08, 2010, 03:31:46 am »
I'm using the sprite's Width and Height parameters to resize sprites to specific pixel-specific sizes.  I just got the SFML v1.6 release today and I had a question about what seems to be a behavioral difference from v1.5.

In v1.6, a sprite's position seems to be shifting as the sprite is resized.  The larger the sprite is resized, the more the sprite's position is shifted.

Using the code below, here are pictures of the difference I'm seeing between v1.5 and v.6:

In v1.5, I can draw my resized sprite at a given location:

But when I try the same thing in v.16, the resized sprite is shifted right:

The length of the "gap" seems to be determined by how large I resize the red rectangle.

Code: [Select]

//draw little green dot at 500,300
DrawGreenDot(new Vector(500, 300));

//draw the red box
DrawBox(new Vector2(500, 300), new Vector2(400, 60));


void DrawBox(Vector2 position, Vector2 sizeVector)
Sprite s = new Sprite(Assets.sheet0);
s.SubRect = new IntRect(1,1,8,8);
s.Color = new Color(255,0,0,128);
s.Position = position;
s.Width = sizeVector.X;
s.Height = sizeVector.Y;


Am I perhaps using the Width and Height parameters incorrectly?

(I am using the .Net build)[/img]

Graphics / [SOLVED] View manipulation - always entire screen?
« on: March 28, 2010, 07:42:34 pm »
I'm using View to zoom in/out of my gameplay screens.  If I understand it correctly, the View grabs the entire RenderWindow and manipulates it.

My question is, what's the best way to not manipulate the entire screen?  For example, if I press ESC to open an options menu, ideally the options menu shouldn't also be zoomed-in.

Is there a way to draw "unzoomed" graphics elements over a View-manipulated gameplay screen?

Pages: 1 [2]