@yojimbo2000 , here’s my current code.
function addInfoScreen()
local infoText = [['Double Choose' is two small adventure games written entirely by my daughters Rosie and Charlotte. Tap on Rosie to play her game, and tap on Charlotte to play hers.
Rosie did the art for her game, and I did most of Charlotte's game under her firm art-direction.
You'll enjoy the games most by trying to find all the possible endings. Rosie's game has awesome emotionally-excruciating endings. Charlotte actually included a little adventure-game-style inventory management--impressive for a five-year-old!
We made it with the excellent iPad app Codea. We hope you enjoy our games, and we especially hope they inspire other kids to make games too. Try Codea, it rocks!]]
--define parameters for the info window
local insetX, insetY = math.floor(WIDTH * 0.04), math.floor(HEIGHT * 0.04)
local windowW, windowH = WIDTH - (insetX * 2), HEIGHT - (insetY * 2)
local textW, textH = windowW - (insetX * 2), windowH - (insetY * 2)
local iFontName = "GillSans-Light"
local iFontSize = 1.75
local infoColor = color(198, 110, 198, 255)
local showInfo = function()
local window = Soda.Window {
title = "",
blurred = true,
close = true,
style = {
shape = {fill = color(37, 37, 37, 255), stroke = "midGrey", strokeWidth = iStrokeWidth}, text = {}},
x = insetX, y = insetY, w = windowW, h = windowH
}
local subWindow = Soda.Window {
parent = window,
title = infoText,
style = {
shape = {fill = color(0, 0, 0, 0), stroke = "midGrey", strokeWidth = iStrokeWidth},
text = {fontSize = iFontSize, font = iFontName, fill=infoColor, textAlign = LEFT},
},
x = 0, y = -1 * windowH / 3.65, w = windowW, h = windowH
}
end
--determine the correct the size of the info circle
local iCircleSize = WIDTH * 0.065
--define the placement of the info circle
local iCircleOffset = iCircleSize * 0.48
local infoCircleFontSize = iFontSize * 1.9
local iStrokeWidth = infoCircleFontSize * 0.85
local iCircleColor = color(144, 125, 144, 255)
infoButtonTable = Soda.Button{
title = "i",
style = {
shape = {fill = color(0, 0, 0, 0), stroke = iCircleColor, strokeWidth = iStrokeWidth},
text = {fontSize = infoCircleFontSize, font = "GillSans", fill=iCircleColor},
highlight = {
text = {fontSize = infoCircleFontSize, font = "GillSans", fill=color(0, 0, 0, 0)},
shape = {fill = iCircleColor}
}
},
shape = Soda.ellipse,
x = 20, y = 20, w = iCircleSize, h = iCircleSize,
callback = showInfo
}
end
Of note:
- I couldn’t get text scroll and text window to change their font size, font, and font color, so I ended up using two window elements.
- Because window elements only display text in the title area, to get the info text placed correctly I had to do kludgy things like ‘y = -1 * windowH / 3.65’, manually scooting the child element down so that the text appeared to be actually contained inside the parent window.
- I had to use math.floor (…) on my x/y calculations to get my windows to appear at all; as I noted in the main Soda thread, x/y values that have decimals don’t seem to work.
Please let me know if you have any tips!