How can I make pyglet start my animation from the top left instead of the bottom left?How can I make a time delay in Python?How can I create a “Please Wait, Loading…” animation using jQuery?working with large sprite sheets on iphoneAndroid: tween animation of a bitmapCreate image of part of an other imageCSS background scrollingjquery one row sprite sheetpygame spritesheet sprite animationControlling sprite animation with keypressPhaser 3: some animations stopped playing suddenly
Does the US Supreme Court vote using secret ballots?
how to create an executable file for an AppleScript?
Why are stats in Angband written as 18/** instead of 19, 20...?
Pedaling at different gear ratios on flat terrain: what's the point?
Quotient of Three Dimensional Torus by Permutation on Coordinates
Can I modify the report menu?
What technology would Dwarves need to forge titanium?
Was Tyrion always a poor strategist?
Failing students when it might cause them economic ruin
Why use a retrograde orbit?
Shortest amud or daf in Shas?
Have the writers and actors of GOT responded to its poor reception?
What color to choose as "danger" if the main color of my app is red
How can I monitor the bulk API limit?
How does this piece of code determine array size without using sizeof( )?
Why aren't satellites disintegrated even though they orbit earth within earth's Roche Limits?
Does the usage of mathematical symbols work differently in books than in theses?
The underlying space of an affine open dense subscheme
Is it standard to have the first week's pay indefinitely withheld?
How would fantasy dwarves exist, realistically?
How many Dothraki are left as of Game of Thrones S8E5?
Gaussian kernel density estimation with data from file
How to get all possible paths in 0/1 matrix better way?
Working hours and productivity expectations for game artists and programmers
How can I make pyglet start my animation from the top left instead of the bottom left?
How can I make a time delay in Python?How can I create a “Please Wait, Loading…” animation using jQuery?working with large sprite sheets on iphoneAndroid: tween animation of a bitmapCreate image of part of an other imageCSS background scrollingjquery one row sprite sheetpygame spritesheet sprite animationControlling sprite animation with keypressPhaser 3: some animations stopped playing suddenly
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I followed a tutorial on how to use a sprite sheet to create an animation. It works fine and all- except for the fact that the way that my sprite sheet is set up does not work out with how pyglet runs through the sprite sheet. The way that pyglet likes to do it, is start in the bottom left, go through the row, then once it reaches the end it of that row, it goes to the left and a row above the first and so on.
I already looked around the documentation and found a comment on someone else's post saying to change the anchor_y, and when I tried that it didn't seem to change anything at all.
This is the code that creates the animation, and lower along in the program it is drawn to the screen, so that part works just fine. I wonder if there's anything I can do to change this so that I can have it cycle through my sprite sheet the way I would want it to.
explosion = pyglet.image.load('resources/sprites/explosion.png')
explosion_seq = pyglet.image.ImageGrid(explosion, 5, 5, item_width=32, item_height=32)
explosion_texture = pyglet.image.TextureGrid(explosion_seq)
explosion_animation = pyglet.image.Animation.from_image_sequence(explosion_texture[0:], 0.75, loop=True)
self.explosion_sprite = Sprite(explosion_animation, x=200, y=300)
The way I would like it to work would be to start at the top left, cycle through the whole row, then go back to the left but then be on the row below the first one, and so on and so forth.
Any help would be greatly appreciated!
python python-3.x animation pyglet sprite-sheet
add a comment |
I followed a tutorial on how to use a sprite sheet to create an animation. It works fine and all- except for the fact that the way that my sprite sheet is set up does not work out with how pyglet runs through the sprite sheet. The way that pyglet likes to do it, is start in the bottom left, go through the row, then once it reaches the end it of that row, it goes to the left and a row above the first and so on.
I already looked around the documentation and found a comment on someone else's post saying to change the anchor_y, and when I tried that it didn't seem to change anything at all.
This is the code that creates the animation, and lower along in the program it is drawn to the screen, so that part works just fine. I wonder if there's anything I can do to change this so that I can have it cycle through my sprite sheet the way I would want it to.
explosion = pyglet.image.load('resources/sprites/explosion.png')
explosion_seq = pyglet.image.ImageGrid(explosion, 5, 5, item_width=32, item_height=32)
explosion_texture = pyglet.image.TextureGrid(explosion_seq)
explosion_animation = pyglet.image.Animation.from_image_sequence(explosion_texture[0:], 0.75, loop=True)
self.explosion_sprite = Sprite(explosion_animation, x=200, y=300)
The way I would like it to work would be to start at the top left, cycle through the whole row, then go back to the left but then be on the row below the first one, and so on and so forth.
Any help would be greatly appreciated!
python python-3.x animation pyglet sprite-sheet
1
Could you supply a test-image we can try with? Would help test the code. We could create our own but lack of time it would help a lot : )
– Torxed
Mar 24 at 11:05
Sure! imgur.com/a/ZJVfalp
– 360programmer
Mar 24 at 17:53
add a comment |
I followed a tutorial on how to use a sprite sheet to create an animation. It works fine and all- except for the fact that the way that my sprite sheet is set up does not work out with how pyglet runs through the sprite sheet. The way that pyglet likes to do it, is start in the bottom left, go through the row, then once it reaches the end it of that row, it goes to the left and a row above the first and so on.
I already looked around the documentation and found a comment on someone else's post saying to change the anchor_y, and when I tried that it didn't seem to change anything at all.
This is the code that creates the animation, and lower along in the program it is drawn to the screen, so that part works just fine. I wonder if there's anything I can do to change this so that I can have it cycle through my sprite sheet the way I would want it to.
explosion = pyglet.image.load('resources/sprites/explosion.png')
explosion_seq = pyglet.image.ImageGrid(explosion, 5, 5, item_width=32, item_height=32)
explosion_texture = pyglet.image.TextureGrid(explosion_seq)
explosion_animation = pyglet.image.Animation.from_image_sequence(explosion_texture[0:], 0.75, loop=True)
self.explosion_sprite = Sprite(explosion_animation, x=200, y=300)
The way I would like it to work would be to start at the top left, cycle through the whole row, then go back to the left but then be on the row below the first one, and so on and so forth.
Any help would be greatly appreciated!
python python-3.x animation pyglet sprite-sheet
I followed a tutorial on how to use a sprite sheet to create an animation. It works fine and all- except for the fact that the way that my sprite sheet is set up does not work out with how pyglet runs through the sprite sheet. The way that pyglet likes to do it, is start in the bottom left, go through the row, then once it reaches the end it of that row, it goes to the left and a row above the first and so on.
I already looked around the documentation and found a comment on someone else's post saying to change the anchor_y, and when I tried that it didn't seem to change anything at all.
This is the code that creates the animation, and lower along in the program it is drawn to the screen, so that part works just fine. I wonder if there's anything I can do to change this so that I can have it cycle through my sprite sheet the way I would want it to.
explosion = pyglet.image.load('resources/sprites/explosion.png')
explosion_seq = pyglet.image.ImageGrid(explosion, 5, 5, item_width=32, item_height=32)
explosion_texture = pyglet.image.TextureGrid(explosion_seq)
explosion_animation = pyglet.image.Animation.from_image_sequence(explosion_texture[0:], 0.75, loop=True)
self.explosion_sprite = Sprite(explosion_animation, x=200, y=300)
The way I would like it to work would be to start at the top left, cycle through the whole row, then go back to the left but then be on the row below the first one, and so on and so forth.
Any help would be greatly appreciated!
python python-3.x animation pyglet sprite-sheet
python python-3.x animation pyglet sprite-sheet
asked Mar 23 at 17:08
360programmer360programmer
596
596
1
Could you supply a test-image we can try with? Would help test the code. We could create our own but lack of time it would help a lot : )
– Torxed
Mar 24 at 11:05
Sure! imgur.com/a/ZJVfalp
– 360programmer
Mar 24 at 17:53
add a comment |
1
Could you supply a test-image we can try with? Would help test the code. We could create our own but lack of time it would help a lot : )
– Torxed
Mar 24 at 11:05
Sure! imgur.com/a/ZJVfalp
– 360programmer
Mar 24 at 17:53
1
1
Could you supply a test-image we can try with? Would help test the code. We could create our own but lack of time it would help a lot : )
– Torxed
Mar 24 at 11:05
Could you supply a test-image we can try with? Would help test the code. We could create our own but lack of time it would help a lot : )
– Torxed
Mar 24 at 11:05
Sure! imgur.com/a/ZJVfalp
– 360programmer
Mar 24 at 17:53
Sure! imgur.com/a/ZJVfalp
– 360programmer
Mar 24 at 17:53
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316277%2fhow-can-i-make-pyglet-start-my-animation-from-the-top-left-instead-of-the-bottom%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316277%2fhow-can-i-make-pyglet-start-my-animation-from-the-top-left-instead-of-the-bottom%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Could you supply a test-image we can try with? Would help test the code. We could create our own but lack of time it would help a lot : )
– Torxed
Mar 24 at 11:05
Sure! imgur.com/a/ZJVfalp
– 360programmer
Mar 24 at 17:53