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

Pages: [1]
1
Python / Trouble with pysfml and Windows 7
« on: April 09, 2011, 06:00:37 am »
Hi, thanks for reply. I check again with your example and
get the same result, the program freeze when i close it:



I will compile SFML 2 and go to check again with your binding, i will
write again to tell you the results.

Thanks!!!

2
Python / Trouble with pysfml and Windows 7
« on: April 04, 2011, 12:39:52 am »
Hi, i'm having trouble getting pysfml to work on windows 7.

I run this test code, it only wait two seconds and then
close the main window.

Code: [Select]

import time
from PySFML import sf
window = sf.RenderWindow(sf.VideoMode(320, 240), "Test")

texto = sf.String("Esperando 2 segundos ...")
window.Clear(sf.Color.Green)
window.Draw(texto)
window.Display()

time.sleep(2)

window.Close()


But, when main window close, i get an error saying:



PySFML works on Windows 7?

Thanks in advance for any help.

3
Python / Working in a game framework (need feedback)
« on: November 20, 2010, 12:39:01 am »
Hi, i'm working in a new game framework
for kids and new programmers:

    www.pilas-engine.com.ar

I record some videos using it, you can
see at:
   
    http://www.pilas-engine.com.ar/doku.php?id=documentacion

Pilas is free sotftware, and uses pysfml, pymunk
and cairo to work.

And, i need some help creating games and actors
(aka sprites + behaviors). someone wants to participate?

4
Python / bug in Image.Copy ?
« on: October 14, 2010, 08:40:09 am »
Hi, i working in a new library named pilas [1] with
pySFML but i get a segmentation fault when i try
to copy between images.

By example:

Code: [Select]

from PySFML import sf

window = sf.RenderWindow(sf.VideoMode(800, 600), "PySFML test")
running = True

imagen2 = sf.Image()
imagen2.LoadFromFile("pilas/data/bomba.png")

imagen = sf.Image()
imagen.LoadFromFile("pilas/data/banana.png")

rect = sf.IntRect(0, 0, 10, 10)
imagen.Copy(imagen2, 0, 0, rect)

sprite = sf.Sprite(imagen)


i get in console:

Code: [Select]

/bin/bash: line 1:  6023 Segmentation fault      python test_bug.py

shell returned 139



This is a bug?, is there any way to work around to it?

I want to create a surface with tiles in a simple tiled map editor.

[1] www.pilas-engine.com.ar

5
Python / Re: Translation
« on: March 18, 2010, 12:04:05 am »
Quote from: "genericuser"
Just translated this to English:

PySFML Reference Sheet - English

A bit shoddy translation in places, but should be a good cheat sheet  :)


Thanks!!!, but i can't download it.... can you upload it again?

6
Python / Quick Reference card for pysfml
« on: December 28, 2009, 03:33:01 am »
OK, it's done:

   http://www.sfml-dev.org/wiki/en/tutorials

Thanks.

7
Python / Quick Reference card for pysfml
« on: December 27, 2009, 04:27:30 am »
Hi, i made a simple quick reference card with some API description
and examples for PySFML:

    http://www.losersjuegos.com.ar/_media/referencia/apuntes/pysfml/pysfml_reference_card.pdf

Where is the best place to publish it? here?

8
Python / New example source code to handle sprite sheets
« on: August 01, 2009, 05:29:03 am »
Thanks, it's a good idea. And its more easy to extend.

9
Python / New example source code to handle sprite sheets
« on: July 23, 2009, 01:41:12 am »
Hi, i made a simple class to handle image sheets in
the wiki:

  http://www.sfml-dev.org/wiki/en/sources/spritesheets

Bye.

10
Python / Overloading Render for Sprites
« on: July 15, 2009, 02:56:27 am »
Hi, I think that you can create a new sprite object and
set the behavior that change text's color easy, but handling
events manually:

This examples show how to create a simple menu and change
the text's color with mouse:



source code:

Code: [Select]

# -*- encoding: utf-8 -*-
from PySFML import sf
import sys


class MenuTextSprite(sf.String):

    def __init__(self, text, x, y):
        sf.String.__init__(self, text)
        self.default_color = sf.Color(200, 200, 200)
        self.over_color = sf.Color.White
        self.SetColor(self.default_color)
        self.SetPosition(x, y)
        self.my_rect = self.GetRect()

    def on_mouse_move_event(self, mouse_move_event):
        x, y = mouse_move_event.X, mouse_move_event.Y

        # Check if the mouse are over my.
        if self.my_rect.Contains(x, y):
            self.SetColor(self.over_color)
        else:
            self.SetColor(self.default_color)



app = sf.RenderWindow()
app.Create(sf.VideoMode(320, 240), "Menu")



#create all text items

new_game_text = MenuTextSprite("New Game", 80, 50)
about_text = MenuTextSprite("About this game", 50, 100)
quit_text = MenuTextSprite("Quit", 120, 150)

menu_items_list = [new_game_text, about_text, quit_text]


event = sf.Event()
input = app.GetInput()

background_color = sf.Color(100, 100, 100)

while True:
    app.Clear(background_color)

    for text_item in menu_items_list:
        app.Draw(text_item)

    while app.GetEvent(event):

        x = input.GetMouseX()
        y = input.GetMouseY()

        if event.Type == sf.Event.Closed:
            app.Close()
            sys.exit(0)


        if event.Type == sf.Event.MouseMoved:
            for text_item in menu_items_list:
                text_item.on_mouse_move_event(event.MouseMove)


    app.Display()


You can change other String's attributes like font style, size or
rotation too, only change the "on_mouse_move_event" method.

Bye.

Pages: [1]
anything