Hi, i am working on a tease. There are always two connected images - one censored, one uncensored. My Idea was this:
I have a image folder with images-a and one with images-b and the files are named the same.
when loading images-a/image1.jpg i want to save the filename and load later the same filename from images-b
but it seems there is no way to access or read the filenames? is there a workaround?
Eos programming question
Re: Eos programming question
Unfortunately, as far as I know, you can't dynamically reference image paths. But you can dynamically reference pages.
Best thing I've found is to have a bunch of simple pages that are dedicated to rendering the image. Then define global functions/variables in your global init script to manage them like:
In your Global Init Script
In each of your 'images-[nude/nonnude]-[name/number]' pages.
1. Add your image action
2. Add an Eval:
At the start of any non 'images-[nude/nonnude]-[name/number]' page that you want to load a dynamic image:
Add an Eval:
In any non 'images-[nude/nonnude]-[name/number]' page where you load a non-dynamic image
After your image action, add an Eval:
Never directly go to any of your 'images-[nude/nonnude]-[name/number]' pages. Always should be handled by loadImage(...), and always before you do anything else of consequence on your page, because if the image isn't already loaded, you'll be directed away from then back to the page you're calling loadImage(...) from.
Hope that makes sense.
Best thing I've found is to have a bunch of simple pages that are dedicated to rendering the image. Then define global functions/variables in your global init script to manage them like:
In your Global Init Script
Code: Select all
var imageMode = 'nude'
var loadedImagePagePath = null
var imageCaller = null
// sets image mode
setNudeNonNude(nude) {
imageMode = nude ? 'nude' : 'nonnude'
}
// Loads image page (image page will need to call: returnToImageCaller())
loadImage(image) {
var imagePagePath = 'images-' + imageMode + '-' + image
if (loadedImagePagePath !== imagePagePath) {
// we need to load this image
imageCaller = pages.getCurrentPageId()
loadedImagePagePath = imagePagePath
pages.goto(imagePagePath)
}
}
// Clears loaded image. Should be called if you've loaded an image not using loadImage(...).
clearLoadedImage() {
loadedImagePagePath = null
}
// Returns to loaded image caller
returnToImageCaller() {
pages.goto(imageCaller )
}
1. Add your image action
2. Add an Eval:
Code: Select all
returnToImageCaller()
Add an Eval:
Code: Select all
loadImage(imageName) // where image name is the [name/number] portion of your image page path.
After your image action, add an Eval:
Code: Select all
clearLoadedImage()
Hope that makes sense.
-
- Explorer
- Posts: 96
- Joined: Sat Aug 24, 2019 11:42 am
- Gender: Male
- Location: Germany
Re: Eos programming question
What I like to do, is nest each image in an if-action, with a condition such as
Then you can kind of script images, by setting showImg before all the ifs.
The downside is that it can be tedious to insert all these actions. If you know your way around a code editor you can edit the json-backup-file directly, though.
Code: Select all
showImg=="003-a.jpg"
The downside is that it can be tedious to insert all these actions. If you know your way around a code editor you can edit the json-backup-file directly, though.
-
- Explorer
- Posts: 17
- Joined: Mon Oct 31, 2011 1:25 pm
Re: Eos programming question
I will try that - thank you both!
Who is online
Users browsing this forum: Hampelmann69 and 80 guests