Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Bindings - other languages
»
Python
(Moderator:
Sonkun
) »
[pySFML2-cython] Issue repeating textures
Print
Pages: [
1
]
Author
Topic: [pySFML2-cython] Issue repeating textures (Read 5448 times)
0 Members and 1 Guest are viewing this topic.
Johnny
Newbie
Posts: 2
[pySFML2-cython] Issue repeating textures
«
on:
September 15, 2012, 09:23:01 pm »
I can't figure out how to repeat a texture (without it automatically resizing) over a larger shape.
texture = sf.Texture.load_from_file("test.png")
texture.repeated = True
rectangle.set_texture(texture, reset_rect=False)
The bool values don't appear to do anything. Does anybody know what I'm doing wrong? Thanks.
(A full example:
https://gist.github.com/3728984
)
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: [pySFML2-cython] Issue repeating textures
«
Reply #1 on:
September 15, 2012, 09:47:25 pm »
The area of the texture which is mapped to the shape is defined by the
textureRect
property. So, to have the texture repeated N times, the textureRect must be N times bigger than the texture.
Logged
Laurent Gomila - SFML developer
Johnny
Newbie
Posts: 2
Re: [pySFML2-cython] Issue repeating textures
«
Reply #2 on:
September 15, 2012, 11:36:03 pm »
Aha! That makes sense, it works fine now. Thanks a ton for the prompt and helpful response.
Logged
Print
Pages: [
1
]
SFML community forums
»
Bindings - other languages
»
Python
(Moderator:
Sonkun
) »
[pySFML2-cython] Issue repeating textures