Instant CG and BG gallery
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
-
- Newbie
- Posts: 24
- Joined: Fri Aug 14, 2015 4:09 pm
- Contact:
Re: Instant CG and BG gallery
Hello , I wonder if this would add to the custom code sections for each character having the character name tag and go to your personal gallery
-
- Regular
- Posts: 27
- Joined: Mon Oct 26, 2015 11:33 am
- Tumblr: akira
- Deviantart: akira
- Github: akira
- Contact:
Re: Instant CG and BG gallery
Hello, I wanted to ask you, is the code for unlock the CG is different or something else ?
Because when I commenting out this code g_cg.unlock(gal_item) , my room.jpg is in the CG gallery, but when I not commenting it, the image is replace with unlocked picture.
Thanks
Because when I commenting out this code g_cg.unlock(gal_item) , my room.jpg is in the CG gallery, but when I not commenting it, the image is replace with unlocked picture.
Thanks
-
- Newbie
- Posts: 24
- Joined: Fri Aug 14, 2015 4:09 pm
- Contact:
Re: Instant CG and BG gallery
As you complete your code ?
Maybe just a problem of order among pictures
Maybe just a problem of order among pictures
- karorogunso
- Newbie
- Posts: 6
- Joined: Mon Nov 24, 2014 10:01 am
- Projects: Bluebird
- IRC Nick: karorogunso
- Github: karorogunso
- Location: Thailand
- Contact:
Re: Instant CG and BG gallery
awesome code for make some new template
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3808
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Instant CG and BG gallery
Hi. I notice you should probably explain to people what "define your images" means. It took me around 5 minutes to work out that you meant add an init block above cg gallery which defines the images. If anyone else can't figure the common error out, this is how to fix it.
Anyway, I initially never thought I'd need to join these forums, I thought that browsing the available answers should be all I needed, but I've come across an issue that I can't understand.
On the CG Gallery, I'm testing it with my characters.
When I "see" the first two images, they unlock in the gallery perfectly, as expected.
My problem is that the final CG does NOT unlock, even though I've "seen" it.
Could this be caused by the fact it's used only once as a "show image2 at left as image1".
I'm not understanding this and the documentation on galleries very.... confusing for beginners.
Code: Select all
#CG Gallery
init-1:
image image1 = "image1.png"
image image2 = "image2.png"
## and so on
init python:
#Galleries settings - start
On the CG Gallery, I'm testing it with my characters.
When I "see" the first two images, they unlock in the gallery perfectly, as expected.
My problem is that the final CG does NOT unlock, even though I've "seen" it.
Could this be caused by the fact it's used only once as a "show image2 at left as image1".
I'm not understanding this and the documentation on galleries very.... confusing for beginners.
- Puppeteer
- Newbie
- Posts: 3
- Joined: Sun Dec 13, 2015 8:48 am
- Projects: SGW: Jinx (KN); SGW: Vampire's Garden (ADV)
- Contact:
Re: Instant CG and BG gallery
This is a great resource for adding galleries. Every needed piece does get covered somewhere in this thread: the starting code, adding the buttons for the gallery to the main menu, fixing the pesky "expected image, got displayable" problem.
Being determined to have both a cast gallery for character sprites and a scene gallery for backgrounds, but without having to create images that don't suffer from thumbnail scaling, I tinkered until I found how to tell it to use different criteria for different galleries:
First, you need Leon's code. And it has to work as-is, so make sure it does. (Just to ensure any errors are only from this tweak.)
Second: define your thumbnail types...
At this code
#thumbnail size in pixels:
thumbnail_x = 267
thumbnail_y = 150
Change to this
#thumbnail size in pixels:
cg_thumbnail_x = 150
cg_thumbnail_y = 300
bg_thumbnail_x = 200
bg_thumbnail_y = 150
**or whatever dimensions work best for your images and window size and resolution and all that stuff.
THEN
Change the references to those thumbnails for EACH gallery type.
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
for gal_item in gallery_bg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
becomes
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), cg_thumbnail_x, cg_thumbnail_y))
for gal_item in gallery_bg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), bg_thumbnail_x, bg_thumbnail_y))
and
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
becomes
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.png", cg_thumbnail_x, cg_thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
I was seriously so pleased with myself for getting this to work I declared myself winner of all internets and also danced around the room.
Being determined to have both a cast gallery for character sprites and a scene gallery for backgrounds, but without having to create images that don't suffer from thumbnail scaling, I tinkered until I found how to tell it to use different criteria for different galleries:
First, you need Leon's code. And it has to work as-is, so make sure it does. (Just to ensure any errors are only from this tweak.)
Second: define your thumbnail types...
At this code
#thumbnail size in pixels:
thumbnail_x = 267
thumbnail_y = 150
Change to this
#thumbnail size in pixels:
cg_thumbnail_x = 150
cg_thumbnail_y = 300
bg_thumbnail_x = 200
bg_thumbnail_y = 150
**or whatever dimensions work best for your images and window size and resolution and all that stuff.
THEN
Change the references to those thumbnails for EACH gallery type.
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
for gal_item in gallery_bg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), thumbnail_x, thumbnail_y))
becomes
for gal_item in gallery_cg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), cg_thumbnail_x, cg_thumbnail_y))
for gal_item in gallery_bg_items:
renpy.image (gal_item + " butt", im.Scale(ImageReference(gal_item), bg_thumbnail_x, bg_thumbnail_y))
and
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.png", thumbnail_x, thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
becomes
add g_cg.make_button(gal_item + " butt", gal_item + " butt", im.Scale("gallocked.png", cg_thumbnail_x, cg_thumbnail_y), xalign=0.5, yalign=0.5, idle_border=None, background=None, bottom_margin=24)
I was seriously so pleased with myself for getting this to work I declared myself winner of all internets and also danced around the room.
- vollschauer
- Veteran
- Posts: 231
- Joined: Sun Oct 11, 2015 9:38 am
- Github: vollschauer
- Contact:
Re: Instant CG and BG gallery
After staring the whole day at the gallery code I got mostly everything working, but I like to have for each of my characters it's own gallery...
I don't want to have defined xx galleries and build xx gallery screens, I was thinking about something like this:
I just set the persistent.gl_chare via imagebuton
How can I switch between my characters and get the screen refreshed to rebuild the gallery grid properly?
I don't want to have defined xx galleries and build xx gallery screens, I was thinking about something like this:
Code: Select all
init python:
if persistent.gl_chara is None:
persistent.gl_chara = "chara1"
#Galleries settings - start
#List the CG gallery images here:
if persistent.gl_chara == "chara1":
gallery_cg_items = ["cg1",...]
elif persistent.gl_chara == "chara2":
gallery_cg_items = ["cg2", ...]
elif persistent.gl_chara == "chara3":
gallery_cg_items = ["cg3", ...]
Code: Select all
action SetField(persistent, "gl_chara", "chara1")
- Karizu
- Newbie
- Posts: 19
- Joined: Mon Apr 11, 2016 6:28 am
- Completed: AKUMANGEL (IT)
- Projects: Akumangel: The Madhouse Swing (ENG-IT)
- Organization: Spin.to Studios
- Soundcloud: spin-to-studios
- Contact:
Re: Instant CG and BG gallery
Hi guys, I know this topic is very old but I'm really confused about one point: how can I move the different frames to adapt them to my personal design? I've attached a picture below to let you see what I'm talking about.
Thank you in advance!
Thank you in advance!
Akumangel: The Madhouse Swing: an an investigative-noire visual novel entirely set between the walls of a prestigious mental hospital situated on the outskirts of New York City, during the 40s.
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3808
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Instant CG and BG gallery
I'm on a mobile, so excuse my lack of an example. This is purely a suggestion, without studying the code closely, I can't guarantee my suggestion will even work with this.Karizu wrote:Hi guys, I know this topic is very old but I'm really confused about one point: how can I move the different frames to adapt them to my personal design? I've attached a picture below to let you see what I'm talking about.
Thank you in advance!
You could try setting gallery rows to 2 and columns to 1 and the width to one third of the screen then where it creates the thumbnails, adjust the positioning so its centered (default IIRC), making sure the grid is aligned left.
After that, add two more columns to the grid, one centered, and offset as you have it, one aligned right.
If I had more time, I'd probably write you up an example - I did something similar (though not for a CG gallery)
- Karizu
- Newbie
- Posts: 19
- Joined: Mon Apr 11, 2016 6:28 am
- Completed: AKUMANGEL (IT)
- Projects: Akumangel: The Madhouse Swing (ENG-IT)
- Organization: Spin.to Studios
- Soundcloud: spin-to-studios
- Contact:
Re: Instant CG and BG gallery
Thank you for your answer. I'm a newbie in programming, so I'm not sure I'll manage to do what you said, but I'll try. In any case, if you have any time later, I'd be grateful for a little coding example of what you described in words.
Akumangel: The Madhouse Swing: an an investigative-noire visual novel entirely set between the walls of a prestigious mental hospital situated on the outskirts of New York City, during the 40s.
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3808
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Instant CG and BG gallery
I'll need to know if you're just doing a cg gallery, or including backgrounds or anything else. Also, you're probably going to want some buttons on that (switching pages, returning to the main menu etc.
Could you PM this information to me (so we don't annoy everyone checking this thread) and after work I'll try to come up with something for you.
Could you PM this information to me (so we don't annoy everyone checking this thread) and after work I'll try to come up with something for you.
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- Karizu
- Newbie
- Posts: 19
- Joined: Mon Apr 11, 2016 6:28 am
- Completed: AKUMANGEL (IT)
- Projects: Akumangel: The Madhouse Swing (ENG-IT)
- Organization: Spin.to Studios
- Soundcloud: spin-to-studios
- Contact:
Re: Instant CG and BG gallery
I answered your questions two days ago by a Private Message, but I'm not sure you received it. Please tell me.
Akumangel: The Madhouse Swing: an an investigative-noire visual novel entirely set between the walls of a prestigious mental hospital situated on the outskirts of New York City, during the 40s.
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3808
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Instant CG and BG gallery
The gallery doesn't work as I expected.
I don't currently have the time to make one for you, but I can suggest maybe looking into imagbuttons, instead of imagemaps.
I don't currently have the time to make one for you, but I can suggest maybe looking into imagbuttons, instead of imagemaps.
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- Karizu
- Newbie
- Posts: 19
- Joined: Mon Apr 11, 2016 6:28 am
- Completed: AKUMANGEL (IT)
- Projects: Akumangel: The Madhouse Swing (ENG-IT)
- Organization: Spin.to Studios
- Soundcloud: spin-to-studios
- Contact:
Re: Instant CG and BG gallery
Yes, of course I'm looking into imagebuttons. But I'm probably renouncing and use the standard-shaped gird. Thank you anyway.
Akumangel: The Madhouse Swing: an an investigative-noire visual novel entirely set between the walls of a prestigious mental hospital situated on the outskirts of New York City, during the 40s.
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
Julia Maine - a young and peculiar detective living in uptown NYC - discovers from her father's old notes that many important men and women, coming from politics or high society, have mysteriously disappeared over the years, under unknown circumstances.
All the researches seem to point to the old St Jeremy House, an ancient manor converted into an asylum, but beside these poor informations, the notes give no sign of hard evidence.
During a period of forced unemployment caused by the critic loss of interesting cases, Julia decides to get hospitalized in the madhouse in order to investigate and resolve the case, firmly convinced that the most of the "mad" patients have actually been kidnapped by some secret organization.
Website: http://akumangeltms.blogspot.com
- RayDizzle
- Regular
- Posts: 25
- Joined: Tue Jul 28, 2015 9:49 pm
- Deviantart: Gem2012
- Location: New Zealand
- Contact:
Re: Instant CG and BG gallery
Hi, I know this thread is quite old but I was quite confused as to how exactly you unlock the gallery images after they've been shown in the script.rpy file. The rest of it works fine, I just need to know how to actually unlock the images. Thanks!
Who is online
Users browsing this forum: No registered users