Renpy "sprites"?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Renpy "sprites"?

#1 Post by Errilhl »

Okay, I'm a little bit confused about Renpy and sprites - both the naming, and the usage.

First - does Renpy refer to any image as a "sprite"?
While that is acceptable, coming from a web-design background, that is confusing, since a sprite is a collection of images put into one larger image, and then used by defining a position on that image to show.

Second - if Renpy uses "image" and "sprite" as synonyms, is there a way to define a "CSS sprite"? Or should I just have separate sprites (images) for each and every emotion and the like? (Seems that that can quickly become a lot of images, but sure)

If it is possible to have a "CSS sprite" functionality, how would one define / use that?
Currently working on: Image

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Renpy "sprites"?

#2 Post by Remix »

Dictionary.com - an icon in a computer game which can be manoeuvred around the screen by means of a joystick, etc
Google Meaning - a computer graphic which may be moved on-screen and otherwise manipulated as a single entity.

Both seem to indicate Sprite as the same as how Ren'py uses the term, basically all the images that are not scene backgrounds, buttons, frames, gui etc.

I would say a collection of images gathered as a single image where the parts are cropped out as needed is more commonly termed a sprite-sheet and though Ren'py does not have an in-built sprite-sheet reader it should not be too tricky to run one up.
I would suggest using the common XML format like Leshy uses, read that using ElementTree ( import xml.etree.ElementTree as etree sort of approach ) and crop/render using an approach similar to the legacy FilmStrip method ( renpy\display\anim.py line 570 ish ) or LiveCrop() to create images ( as simple as ... sprite = LiveCrop( ( x, y, w, h ), "sprites/sprite_sheet.png" ) ... )

Not dabbled with CSS in many years. so I am not familiar with how it uses Sprites... hopefully the above info is useful though.
Frameworks & Scriptlets:

Errilhl
Regular
Posts: 164
Joined: Wed Nov 08, 2017 4:32 pm
Projects: HSS
Deviantart: studioerrilhl
Github: studioerrilhl
Contact:

Re: Renpy "sprites"?

#3 Post by Errilhl »

Okay, thanks :) Oh, I will probably not get into that (trying to make a sheet, so to speak) - I was just wondering, because the term (to me) is a bit confusing, especially since it mucks about with both images and sprites a little haphazardly. But that's good to know, then I will just have to create separate images, basically :)
Currently working on: Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Renpy "sprites"?

#4 Post by Imperf3kt »

In web terminology, you would actually call what you described as a "sprite", a "spritesheet"

Regarding having one image for each emotion, you can save yourself a lot of file size, by using live composite
https://www.renpy.org/doc/html/displaya ... splayables

I haven't used this function, so am not sure what its actually called.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot]