Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

You can’t put an active widget into a rich text field, but you can put a link into a rich text field, and there’s a link event that fires when the user clicks on a link, so that would probably be the easiest way to deal with it.

If you really need a button, you could put a few blank lines at the end of the rich text field, put an extra button inside the contraption, and have an event handler that continually adjusts the position of the button based on the field’s .scroll property. You’ll probably also need to use the maxscroll helper function from that post to figure out whether you’re within (button height) pixels of the end of the content. You may also need to mess with widget ordering to make sure the button appears above the rich text field but behind the horizontal scroll bar.

For the second question, when you say “Font Importer”, do you mean the deck described in this post? For the font you describe, you’ll need the deck as described in the OP, and the changes to support sizes other than 8x8, and the changes to support modern versions of Decker. You should also have your font as black text on a white background - if you want it to appear in white, you can use Decker’s text formatting tools later. Lastly, importing a font adds it to the list of fonts embedded in that deck - to use it anywhere else, save the deck to a file, then open the deck where you want to use the font in Decker, drag-and-drop the deck-with-the-font onto Decker, which should bring up the Font/DA Mover where you can copy it across.

(1 edit)

Hmm, I did try adding the aforementioned script to try and have the button appear when the field has scrolled down all the way instead, but could not get that to work as it was not targeting the field inside the contraption (I presume). Ultimately, with this I’m mainly trying to have a link that caps off the end of the field when scrolled down that links to the next card—and based on your advice it seems that a link in the rich text field is most hassle free way to accomplish that.

However, while linking some text at the end to the next card works, I’m still trying to parse out how to use the link feature to call an alert[] when some text is linked in the field. From what I understand, I canwrite alert[] or go[] into the scripting area to fire the event directly. Where the confusion stems is regarding if I can link to an alert that displays on the same card, then click Okay and be redirected to the next one.

(+2)

When you click a link in a field, that sends a link event to the field. If the field doesn’t handle it, it bubbles up to the card the field is on - in this case, the contraption’s prototype. If the prototype doesn’t handle the event, it bubbles up to the default event handlers, including this one:

on link x do
 go[x]
end

If you want clicking a link to anything other than go straight to the target, you have to add your own on link... handler to interrupt the default handling.

The easiest thing is just to put it into the prototype’s script, especially if you always want clicking a link in one of these text fields to display an alert before moving on, something like:

on link target do
 alert["You have clicked a link. This will be reported to the authorities."]
 go[target]
end

If you want different contraptions to have different behaviour, you’ll want the link event inside the prototype to become a link event on the contraption, by putting something like this in the prototype’s script:

on link target do
 # forward the event to the contraption
 card.event["link" target]
end

Then you can put different on link... handlers on different copies of the contraption, for different behaviour.