Transparent color in Backdrops vs. Plotscripting

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Setu Firestorm
Slime
Posts: 9
Joined: Sat Aug 31, 2019 7:17 pm
Location: Tampa, Florida
Contact:

Transparent color in Backdrops vs. Plotscripting

Post by Setu Firestorm »

Forgive me if there was a thread on this at one point (didn't find one when I searched, just to make sure I'm not adding to a pile of inquiries about this).

I noticed that if I utilize the "Show Backdrop" command with an image intended to have some transparency in the background, it does not account for allowing transparency (and there didn't appear to be a command or even argument to affect whether or not to account for transparency). So I have a backdrop with a neon-pink background that was intended to be transparent which won't play nice when being called via scripting.

Is there a way to account for transparency when scripting? If not, it's perfectly okay; I'll probably do a workaround by using the backdrop on the two text boxes that go up with it and only have the script call the first one (making the first one connect to the second in-engine, since scripting seems to allow that behavior) and then move on to the rest of the scene.
- George R. Powell (Setu Firestorm)
Digital Music Composer, Writer, Creator
Wingspread Creations
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I'm going to add an argument to "show backdrop" to control transparency; that's an oversight.

In the meantime, although you can't set the transparency with "show backdrop" you can if you display a backdrop slice instead. Slices were added since you last used the engine. A slice is like an HTML element, eg a sprite or a rectange or an invisible container. Almost all graphics (eg maps, npcs, textboxes) are slices and can be manipulated by scripts. https://rpg.hamsterrepublic.com/ohrrpgce/Slices

Code: Select all

plotscript, a cutscene, begin
  variable (sl)
  # Newly created slices default to displaying above the map but below textboxes, and are transparent
  # (You would have to write "set sprite trans (sl, false)" to make it opaque)
  sl := load backdrop sprite (10)
  
  show text box (10)
  # ...etc

  free slice (sl)
end
Last edited by TMC on Mon Sep 16, 2019 12:36 pm, edited 1 time in total.
User avatar
Setu Firestorm
Slime
Posts: 9
Joined: Sat Aug 31, 2019 7:17 pm
Location: Tampa, Florida
Contact:

Post by Setu Firestorm »

Awesome! Thank you much!

The whole "Slice" thing is new to me from when I last used OHRRPGCE, and is high on my To-Do list of researching since I've seen some of the games listed here that appear to have put the concept to work, and if the mechanic is what I think it is, it will make a LOT of cool effects possible that were very cumbersome to pull off in years past.

I have the Wiki page for Slices bookmarked (from the OHR Wiki site), so I can start reading up on it.
- George R. Powell (Setu Firestorm)
Digital Music Composer, Writer, Creator
Wingspread Creations
Post Reply