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

Pages: [1]
1
Python / pySFML 1.3: UTF-8 characters?
« on: October 07, 2014, 07:30:57 pm »
During last week I've been strugling to draw UTF-8 characters on screen without success. I've tried with different encodings in the unicode string (u'aá eé ií oó uú') and combinations with and without # -*- coding: utf-8 -*- at the beginning of the code. The best thing I obtain are squares or interrogation marks instead of the special characters.

Any idea about what should I add or change?

Regards and thanks in advance.

My setup is:
  • Linux Mint 17
  • pySFML 1.3.0
  • Python 2.7.6

And for testing purposes here is my code:

# -*- coding: utf-8 -*-

import math
import sfml

o_window = sfml.RenderWindow(sfml.VideoMode(480, 300), 'PyFe v2.0')
o_window.vertical_synchronization = True
o_window.framerate_limit = 30

o_font = sfml.Font.from_file('/usr/share/fonts/truetype/freefont/FreeSerif.ttf')
o_color = sfml.Color(255, 0, 0)

o_text_ascii = sfml.Text(u'aá eé ií oó uú')
o_text_ascii.color = o_color
o_text_ascii.font = o_font

f_angle = 0

o_rotation = sfml.Transform()
o_rotation.rotate(0.5)


def position(f_angle):
    i_pos_x = 200 + 150 * math.sin(f_angle)
    i_pos_y = 120 + 100 * math.cos(f_angle)

    return i_pos_x, i_pos_y


# Main loop
while o_window.is_open:

    # Handle events
    for event in o_window.events:
        # window closed or escape key pressed: exit
        if type(event) is sfml.CloseEvent:
            o_window.close()

    # Updating
    f_angle += 0.05
    o_text_ascii.position = position(f_angle)

    # Rendering
    o_window.clear(sfml.Color(50, 200, 50))
    o_window.draw(o_text_ascii)

    o_window.display()
 

2
SFML projects / PyFe v2.0
« on: October 04, 2014, 06:53:07 pm »
I've been working in my free time during last year in an emulator game launcher called PyFe v2.0. At the beginning I was using pygame until I realised I needed hardware aceleration to work in HD resolution.

The main feature is all the graphical elements are based on a plugin system. So the general look of the application can be easily changed.

Here you can see a video of the program running:

http://www.youtube.com/watch?v=fG3WicKNWJA

3
Python / pySFML discontinued?
« on: October 04, 2014, 06:36:36 pm »
Hi to everybody, this is my first post here.

I've been using pySFML for a couple of months in my personal project, an emulator front-end/launcher (link), and today I realised the last time it was updated was 27th May of 2013. So I was wondering if the project is discontinued.

Regards


Pages: [1]
anything