Hi All,
As a game mechanic, I wanted to create something where you'd find an item, open your inventory viewer, click on the item, and be able to -- via a scrollbar or just dragging -- rotate the image around (like those 360' image viewers on click on the 360' View). The player could use this to search for 'clues' or just to get a better impression of an item, etc.
My theory was:
[*]create an image and store a reference to this image object (so I can affect its properties later)
[*]take values from a scrollbar and use to create a new image filepath (image_0.png, image_1.png, etc)
[*]change/update the image via its reference with the new image filepath (my_image = new_filepath)
I thought 'renpy.display.image.images[]' might help me control the image objects/attributes, but ... let's be honest, I'm lost, though very willing to learn
Any help would be appreciated
[SOLVED] 360' Scrollable image viewer code help
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.
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.
[SOLVED] 360' Scrollable image viewer code help
Last edited by guiltyGG on Thu Jan 25, 2018 4:34 am, edited 1 time in total.
Re: 360' Scrollable image viewer code help
Figured it out -- I forgot that screens constantly update.
So, by:
then updating the array_pos variable elsewhere, you'll change the image to the next image in the array.
Didn't need to explore the inner workings of Ren'Py afterall, but was an informative trip anyway
So, by:
Code: Select all
$ array_pos = 0
define img = ["pic_01.png", "pic_02.png", ... ]
screen test:
add img[array_pos]
Didn't need to explore the inner workings of Ren'Py afterall, but was an informative trip anyway
Who is online
Users browsing this forum: Google [Bot], Imperf3kt