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

Author Topic: SFML 2.0  (Read 102861 times)

0 Members and 1 Guest are viewing this topic.

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
SFML 2.0
« Reply #105 on: June 26, 2009, 05:00:48 pm »
That's not the issue.
Perhaps I can't use a font because if it's licence and can't ship the game with the game for that reason, or I want some other font in game that doesn't have a pixel version.

If I want to use a Liberation font in point size #4 (which is rather pixelated), it would be nice to be able to disable antialiasing. It's just adding another optional parameter in font load  :roll:  :D
Then (without smoothing) I could scale the sf::String to draw a bigger and more readable text.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #106 on: June 26, 2009, 05:16:21 pm »
Quote
If I want to use a Liberation font in point size #4 (which is rather pixelated), it would be nice to be able to disable antialiasing. It's just adding another optional parameter in font load
Then (without smoothing) I could scale the sf::String to draw a bigger and more readable text.

This would look ugly ;)
Laurent Gomila - SFML developer

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
SFML 2.0
« Reply #107 on: June 27, 2009, 06:11:06 pm »
is it intentional that a sprite moves its position when you change its center?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #108 on: June 27, 2009, 06:38:49 pm »
Yes, because the position (which doesn't change) is now the position of the new center :D
Laurent Gomila - SFML developer

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
SFML 2.0
« Reply #109 on: August 13, 2009, 09:31:26 pm »
applying textures to shapes would be awesome.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #110 on: August 13, 2009, 09:40:01 pm »
For doing what? Do you have a useful example?
Laurent Gomila - SFML developer

eleinvisible

  • Newbie
  • *
  • Posts: 47
    • View Profile
SFML 2.0
« Reply #111 on: August 14, 2009, 01:47:13 am »
Textured polygons would be useful, like in Soldat. Also SDL_gfx provides textured polygons, so perhaps it is something SFML should provide as well?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #112 on: August 14, 2009, 08:35:07 am »
Quote
Textured polygons would be useful, like in Soldat

What is Soldat?

Quote
Also SDL_gfx provides textured polygons, so perhaps it is something SFML should provide as well?

SFML doesn't aim at being a clone of SDL & co ;)
Laurent Gomila - SFML developer

julen26

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • http://julen26.blogspot.com
SFML 2.0
« Reply #113 on: August 14, 2009, 11:59:31 am »
Soldat is a free 2D shooter game online. The maps are done with textured polygons.
Its a good idea if you want to use polygon collisions.

teto

  • Newbie
  • *
  • Posts: 35
    • View Profile
SFML 2.0
« Reply #114 on: August 14, 2009, 04:08:54 pm »
Very good game btw:
www.soldat.pl to download it.
See you net cow-boy ...

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
SFML 2.0
« Reply #115 on: August 14, 2009, 10:22:38 pm »
Quote from: "Laurent"
For doing what? Do you have a useful example?


example: i want to do a 2d sidescroller that isn't based on tiles, because tiles limit your accuracy of movement (cause tiles are quad blocks). you can't really do realistic slopes, you always have to simulate them. stuff like loopings that aren't hardcoded like the ones you see in the sonic games would also be very hard to do. having actual slopes (meaning lines that are somehow rotated) makes calculations a lot easier.

now let's say you have a rock that has 7 corners. at the moment in sfml you can't really do stuff like that, cause you'd have to write an extremely slow and complex algorithm that creates sprites for you which replace a natural texture. you'd have to draw a lot of sprites to fill in the little gaps that come because sprites are quads, or alternatively you'd have to draw a seperate texture resembling a 7-corner-rock and manually attack it to your ingame rock.

all of that stuff is really complicated. it would be easier to just have the possibilty to take a texture and "lay it upon" a certain shape.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0
« Reply #116 on: August 14, 2009, 11:10:57 pm »
Ok, I understand. I'll think about it.
Laurent Gomila - SFML developer

eleinvisible

  • Newbie
  • *
  • Posts: 47
    • View Profile
SFML 2.0
« Reply #117 on: August 15, 2009, 02:30:12 am »
Quote from: "Laurent"
SFML doesn't aim at being a clone of SDL & co ;)
Of course not, it aims to exceed them in all aspects :wink:

Jaenis

  • Newbie
  • *
  • Posts: 48
    • View Profile
SFML 2.0
« Reply #118 on: August 15, 2009, 07:33:40 am »
Quote from: "heishe"
now let's say you have a rock that has 7 corners. at the moment in sfml you can't really do stuff like that


Couldn't you use OpenGL to draw a 7 sided polygon for you?
Something like:
Code: [Select]
// Structure for coordinates
struct Coordinates
{
float x,y;
};

// Declare rock vertices and texture coordinates
struct Coordinates RockVert[7]={ {0,10}, {10,5}, ... };
struct Coordinates RockTex[7]={ {0,0}, {1,0.5}, ... };

// Load sf::Image
...
// Bind the image and set it to repeat, not mandatory
Image.Bind();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);


// Inside main loop
{
...

// Draw polygon
Image.Bind();
glBegin(GL_POLYGON);
for (int i=0; i<7; i++)
{
glTexCoord2f(RockTex[i].x, RockTex[i].y);
glVertex2f(RockVert[i].x, RockVert[i].y);
}
glEnd();

...
}


If you want to set that texture repeating, it width and height has to be power of two (hardware requirement).
For example, texture size 128x128 or 32x64 will work with that repeat command.

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
SFML 2.0
« Reply #119 on: August 15, 2009, 11:53:37 am »
yes of course i could do that and indeed i do that manually at the moment, but that's not really the point of asking for the feature.

i would not ask a manufacturer to build me a car because i don't know how to do it. i could build me a car, but it's complicated and time consuming. also building my own car without standardized equipment will make it hard for me to customize it later :) okay enough of the analogy here. you get what i mean.

 

anything