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

Author Topic: odd fonts issue, not being positioned right.  (Read 3047 times)

0 Members and 1 Guest are viewing this topic.

seoushi

  • Newbie
  • *
  • Posts: 15
    • View Profile
odd fonts issue, not being positioned right.
« on: July 20, 2008, 06:26:42 am »
I just started using the library and it's quite nice, much better alternative than sdl :).

Anyways the issue I'm having is that my text is not being drawn in the right position, it's down right odd imho.

if I use SetPosition(0.0f, 0.0f) it shows in the upper left corner (thats fine)
if I use SetPosition(1.0f, 1.0f) nothing shows (or any other number it seems)

if I use SetCenter(0.0f, 0,0f) it shows at the top left corner just like SetPosition, it doesn't center like you would think

if I use SetCenter with positive numbers it moves it backwards and with negitive numbers it moves it forwards (backwards of what sprites do and what you would expect)


So in other words SetPosition() just seemed wrong in general as it only works on the origin and SetCentered() moves backwards of what you would expect and doesn't actually center it (just uses the top left of that position).

Also Move() seems to have no effect.

Sprites seem to work fine so I figure this is a font specific issue.



Just some general information:

I am  including all of smfl in my project (no libs)
Compiler: gcc 4.3.1
OS: Debian (Sid)
Arch: x86_64
SMFL version: 1.3 (latest stable on site, not svn)


So is this just me having a werid issue or am I using fonts/text wrong?
Also is there an irc channel?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
odd fonts issue, not being positioned right.
« Reply #1 on: July 20, 2008, 01:50:48 pm »
The SetPosition issue is weird, as the code is the same for every other drawable (Sprite, Shape, ...). Could you show us your code ? Does the tutorial source work ? How about the OpenGL sample of the SDK ?

The behaviour with SetCenter is fine, if you move the center then the object moves in the opposite direction so that the new center remains in the same position (if "center" doesn't tell you much, think of it as "origin").
Laurent Gomila - SFML developer

seoushi

  • Newbie
  • *
  • Posts: 15
    • View Profile
odd fonts issue, not being positioned right.
« Reply #2 on: July 20, 2008, 07:58:40 pm »
Ok, SetCenter makes a little more sense now but I just assumed that it would center the text (or other drawable) arround the point given.

I just made a simplier test case and it seems to work fine, now I'm curious why my regular code doesn't work as I checked the varible memory before I drew it there and in my test case and it is the same.

I would post the orignal code but it's quite big for just showing off that drawing text doesn't work right in that case. I'll have to narrow it down and see if I can find something I'm doing wrong before I post it.

Thanks for the help.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
odd fonts issue, not being positioned right.
« Reply #3 on: July 21, 2008, 03:11:31 am »
Ok, let me know if you can find something.
Laurent Gomila - SFML developer