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

Pages: [1]
1
SFML projects / Another tile map editor
« on: April 08, 2014, 09:52:19 pm »
Hello.

I introduce you my own tile map editor, made with pySFML and gobject-introspection (gtk3 on python). Actually, it doesn't work on Window, because Gtk's Dlls are "broken" (I have some problems with texts.....)

The format of the map is a XML format. I think it is easier to use this format for its implementation.

Actually the main part of the program works : I can save and open my format file, use dynamic and static tiles on layers, set tile properties (name, type) and soon others properties made by you ! You can also make objects, etc.

You can find the code here : https://github.com/Gaulois94/TiledMapEditor

The pysfml version you have to use is on my repository : https://github.com/Gaulois94/python-sfml because I add on it some function for the implementation with Gtk.



The maximum of the map is around "45x45" (because the Minimap crash after that, I'm looking why).

Else, the program is slow after.... 50x50 on my computer.

Thank you for your reading, and sorry for my english :) .

2
Python / [Solved] sf.Vector2(sf.Vector2) create some problems
« on: July 10, 2013, 09:52:34 pm »
Hi . I'm post today for saying that if you do newVector = sf.Vector2(vector) where vector is a sf.Vector2 too, then newVector.x is a sf.Vector2 and newVector.y = 0. Can we have a constructor who do a copy of the first sf.Vector2 ? Thank you :) .

3
Python / [Solved] Somes problems with sf.Event
« on: May 04, 2013, 07:00:39 pm »
It's me again :D

Well, today I have fix somes of my problems and only one survive. When I launch my script (test.py : see src.zip), only one time on two the script doesn't throw a segmentation fault. After many and many test, I found the problem :

TypeError: 'sfml.window.ResizeEvent' object is not iterable

When I do (on EventManager.update() ) :

for event in window.events:
    some code....

At the beginning, the window is resize. If the first test doesn't yield an error, I can resize my window, here isn't the problem : the problem is that an event can't be a sf.ResizeEvent for the first (and only the first) test I think (I'm not sur for 100% ).

with GDB, I have this errors on the traceback (always one time on two) :

Program received signal SIGSEGV, Segmentation fault.
PyObject_GetAttrString (v=0x6d00000005750000, name=0x7ffff1d244c8 "on_resize") at Objects/object.c:819
819     Objects/object.c: Aucun fichier ou dossier de ce type.
 

You can find the source on the attachment (the most importante in this sources are the property and the updates functions only). Maybe the problem is that my guiml.Window inherite from sf.RenderWindow, I don't know... (Indeed, with a sf.RenderWindow, I don't have this problem).

Thank you and sorry for desagrements :) .

[attachment deleted by admin]

4
Python / sfml.View.viewport ? (pysfml-cython)
« on: May 02, 2013, 09:49:44 pm »
Hello,

Well I'm training and working with bastien's pysfml2.0 and I test what doing the sfml.View.viewport. When I do this :

window.view.viewport = sf.FloatRect(0,0,0.5,0.5)

It's the same thing than if I tried to zoom of 2 my view. But, if I correctly understood the documentation, It have to zoom of 0.5, right ? (here,, my drawables are tiny and their position (in the window) near to the center, instead of they are big and far of the center of my view).

Oh, and a last thing : why the center and the size of a view is a tuple and not a sf.Vector2f ?

Well, thank you :) .

5
Python / Compilations errors
« on: January 22, 2013, 08:30:01 pm »
Hello,

First, sorry for my bad english, as you can see, I'm not english. Well, I have a problem when I want to compile pysfml. I'm on archlinux, and my sfml version is update.

Well, the errors are the followings :

running build
running build_ext
cythoning src/sfml.pyx to src/sfml.cpp
building 'sfml' extension
creating build
creating build/temp.linux-x86_64-3.3
creating build/temp.linux-x86_64-3.3/src
gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.3m -c src/sfml.cpp -o build/temp.linux-x86_64-3.3/src/sfml.o
cc1plus: attention : command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
src/sfml.cpp: In function ‘PyObject* __pyx_pf_4sfml_7Texture_12bind(__pyx_obj_4sfml_Texture*, int)’:
src/sfml.cpp:27247:84: erreur: no matching function for call to ‘sf::Texture::bind(sf::Texture::CoordinateType)’
src/sfml.cpp:27247:84: note: candidate is:
In file included from /usr/include/SFML/Graphics/Font.hpp:33:0,
                 from /usr/include/SFML/Graphics.hpp:35,
                 from src/sfml.cpp:264:
/usr/include/SFML/Graphics/Texture.hpp:454:17: note: static void sf::Texture::bind(const sf::Texture*, sf::Texture::CoordinateType)
/usr/include/SFML/Graphics/Texture.hpp:454:17: note:   no known conversion for argument 1 from ‘sf::Texture::CoordinateType’ to ‘const sf::Texture*’
src/sfml.cpp: In function ‘PyObject* __pyx_pf_4sfml_6Shader_16bind(__pyx_obj_4sfml_Shader*)’:
src/sfml.cpp:39040:30: erreur: no matching function for call to ‘sf::Shader::bind()’
src/sfml.cpp:39040:30: note: candidate is:
In file included from /usr/include/SFML/Graphics.hpp:41:0,
                 from src/sfml.cpp:264:
/usr/include/SFML/Graphics/Shader.hpp:471:17: note: static void sf::Shader::bind(const sf::Shader*)
/usr/include/SFML/Graphics/Shader.hpp:471:17: note:   candidate expects 1 argument, 0 provided
src/sfml.cpp: At global scope:
src/sfml.cpp:34929:39: attention : ‘__pyx_obj_4sfml_Vertex* __pyx_f_4sfml_wrap_vertex_instance(sf::Vertex*)’ defined but not used [-Wunused-function]
error: command 'gcc' failed with exit status 1
 

Thank you for your attention.

6
Python / Compilation failed : sf::Shader::unbind doesn't exist
« on: November 04, 2012, 10:04:00 pm »
Hi everybody,

First, sorry for my bad english, I'm not used to writing in english. Why I post here and not in the french forum ? Because here is more active and I try to perform my english.

Well, I have a problem with de pysfml compilation : gcc can not find the member unbind in sf::Shader class. I have tried to launch patch.py but it didn't work. I use the latest sfml source (from git) and use python3 too.

Here it's the exact error :

If the build fails, run patch.py and try again
----------------------------------------------

running build
running build_ext
building 'sfml' extension
gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.3m -c src/sfml.cpp -o build/temp.linux-x86_64-3.3/src/sfml.o
cc1plus: attention : command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
src/sfml.cpp: In function ‘PyObject* __pyx_pf_4sfml_6Shader_20unbind(__pyx_obj_4sfml_Shader*)’:
src/sfml.cpp:39367:25: erreur: ‘class sf::Shader’ has no member named ‘unbind’
src/sfml.cpp: At global scope:
src/sfml.cpp:34862:39: attention : ‘__pyx_obj_4sfml_Vertex* __pyx_f_4sfml_wrap_vertex_instance(sf::Vertex*)’ defined but not used [-Wunused-function]
error: command 'gcc' failed with exit status 1
 

Thank you in advance.

7
Good night,

Well, today, I will to talk you about GUIML and PYGUIML. This libraries are GUI for SFML and PYSFML. In this time, this GUI are in development, and haven't many Widget.

The Goal of this libraries it's be very simple. Indeed, we can use and create Widgets very simple. For exemple, this code

#include "Widget.h"
#include "Button.h"
#include "Window.h"
#include "Frame.h"
#include <iostream>

int main()
{
        guiml::Window window(sf::VideoMode(800, 600), "teste");
        guiml::Frame frame(&window, sf::IntRect(100, 100, 550, 400), sf::Color(0, 255, 255), guiml::Image(), guiml::Label(NULL, std::string("Teste")), sf::Color(255, 0, 0));
        guiml::Label label(NULL, std::string("Sa marche"));
        guiml::Button button(&frame, label, sf::IntRect(40, 14, 250, 160));
        while(window.isOpen())
        {
                if(button.isActived())
                        std::cout << "1" << std::endl;
                window.update();
        }
        return 0;
}

do



The "1" behind the console significated that the Button "Sa marche" (in frenche, it meens "It Works") was actived with de Right Click Mouse.

This lib managed also the window resize : if you resize your window, the widgets' position and size are adjusted.

The PYSFML version don't are very advanced, but I will correct it ;) .

You can download and see the sources of PYSFML here https://github.com/Gaulois94/PYGUIML and for GUIML here : https://github.com/Gaulois94/GUIML
 
Thanks for all.

ps : sorry for my bad english, I'm French and I'm 16 years old.

Pages: [1]
anything