Clearing text but not images?

I’m trying out a new format for the story I’m making, which involved the text clearing to save on scrolling. However, I want the image at the top of the page to stay the same until I want to change it, but clearing the next also clears the image (but not the music that’s playing), so at the moment I have to re-add the image every time the text is cleared. Which doesn’t seem like too much of a problem, except the image is clearly shown to load, making it look like it refreshed, which just looks annoying when it’s the same image.

The code I’m using to reveal parts of a passage and clear text is a custom one from here: cycy-wrote-custom-macros/click-to-proceed at master · cyrusfirheir/cycy-wrote-custom-macros · GitHub

Is it possible to get only the text to clear and not the images until I want the image to change? Or am I going to have to get used to the same image “refreshing”?

Hiya

Could you share your current code with us? That way it will be easier for us to see what’s going on, and give a good answer :slight_smile:

(though it seems like your image is not outside the click-to-proceed macro, which is why it disappears every time, but if you put it outside of the CTP code, you will not have this issue. If you want to load/remove it in the middle of the CTP sequence, you can either use the <<replace>> macro (empty if you want to remove/filled if you want to show a (different) image), or Cycy’s Liveupdate custom macro (same github) )

I do have the images inside the CTP specifically because I wanted to change them in the same passage. Which codes do I need to use for the other way you just mentioned, and do I have to add something to the javascript for it or not? By that I mean how do I use the <<replace>> one?

I would be easier to see how we can make your code fit what you need if we could see it :wink:

(you can copy the code inside a preformatted text block, the </> icon in the formatting bar on the Forum)

Here’s an example, but with placeholder names (I forgot to use placeholders last time I had to use code as an example)

<<ctp "Passage00">><center><img src="Images/animage.png" alt="An image" /></center>

Text

<<ctpNext clear t8n>>

<center><img src="Images/adifferentimage.png" alt="A different image" /></center>

Text

<<ctpNext clear t8n>>

OK so, if the image needs to change with every CTP action for that passage, the example you provided is fine as it is.

However, if you are planning on keeping the same image for multiple CTP action in one same passage:

<div id="image-to-change"></div>
<<ctp "Passage00">>
    Your starting text.
<<ctpNext clear t8n>>
      The Next text AND we change the picture:
      <<replace "#image-to-change">>
          <center><img src="Images/animage.png" alt="An image" /></center>
     <</replace>>
<<ctpNext clear t8n>>
       The new new text, but we don't change the picture
<<ctpNext clear t8n>>
       Even newer text, no picture change.
<<ctpNext clear t8n>>
       But let's change the picture here
      <<replace "#image-to-change">>
          <center><img src="Images/secongimage.png" alt="An image" /></center>
     <</replace>>

<<ctpNext clear t8n>>
 etc. etc. etc.

Thanks, it works now.