Sounds like you're planning on creating an RPG game, maybe you will be wanting an info scroller of some kind?
I threw this together earlier just in case you want a first-in first-out kind of scroller, you may need to modify it but the basics are in there.
Main reason for me including this code is because it's sort of similar to the multiline text you say you wanted, apart from this one scrolls instead of planting line text on a button. Still uses the same text commands that you'll need for what you were talking about further up.
P.S: The info that scrolls up the screen is not important, in case you were wondering, it just text from a file in another game project I did a few months back.
// Project: MultilineText
// Created: 22-08-13
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "MultilineText" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 )
// First-In First-Out text info vertical scroller.
// Copyleft 2022.
// Anyone can use this for any purpous they see fit,
// as long as I don't get blamed if it somehow breaks your project,
// or blows the lid off your workstation,
// or indeed somehow causes your cat to spontaniously grow wings and take to the skies
// to catch the flying mutant mouses that your project may or may not have already created, etc, etc...
// And yeah, I said mouses, computer mouses that is.
// Noone travels down a road and says "Oh look! what a lovely row of hice!"
// Although I do refer to multiples of the little squeakers as mouses just because I can and because I know it annoys other people.
global textInfo as integer // These variables must be accessable globally.
global textInfoPositionX as float // ********************************************
global textInfoPositionY as float // ********************************************
global textInfoSize as float // ********************************************
textInfoSize = 28
textInfo = CreateText("") // Create a text object.
SetTextSize(textInfo, textInfoSize) // Give it a size.
SetTextInfoPosition(0, 300) // Postion its top-left origin.
AddTextInfoLine("Big") // And then add a line of text content to it,
AddTextInfoLine("Shiny") // and another line of text,
AddTextInfoLine("Bulbz") // and another...
AddTextInfoLine("") // Leave the parameter as double quotes for blank line entires.
AddTextInfoLine("") // ************************************************************
AddTextInfoLine("") // ************************************************************
gosub Info // Same as above but more.
do
DrawLine(textInfoPositionX, textInfoPositionY, textInfoPositionX + 200, textInfoPositionY, 255, 255, 355)
Sync()
UpdateTextInfo()
loop
function SetTextInfoPosition(x as float, y as float) // Sets the top-left origin of the text info.
textInfoPositionX = x
textInfoPositionY = y
SetTextPosition(textInfo, x, y) // Give the text info the same position of x and y.
endfunction
function AddTextInfoLine(line as string) // Adds a line of text after the last line entry of the text info.
SetTextString(textInfo, GetTextString(textInfo) + line + chr(10))
endfunction
function ScrollTextUp(value as float) // Moves the text info up by a desired number of pixels.
SetTextY(textInfo, GetTextY(textInfo) - value)
if GetTextY(textInfo) <= textInfoPositionY - GetFirstTextInfoLineHeight() // When the first line of the text info is minus its
RemoveFirstTextInfoLine() // height above its y-origin, remove the first line entry
SetTextY(textInfo, textInfoPositionY) // and reset the text object to the text info y-origin.
endif
//print(textInfoPositionY - GetFirstTextInfoLineHeight())
endfunction
function RemoveFirstTextInfoLine() // Removes the first line entry of the text info.
local i as integer
local newTextString as string
i = FindString(GetTextString(textInfo), chr(10)) // Find the position of the carriage return
newTextString = mid(GetTextString(textInfo), i + 1, -1) // and create a new string from the beginning of the text info
// to the position of the carriage return.
SetTextString(textInfo, newTextString) // Plonk the new string into text info.
endfunction
function GetFirstTextInfoLineHeight() // Gets the height of the first text info entry.
local line as string
local i as integer
local tempTextObject as integer
local height as float
line = GetTextString(textInfo) // Create a temporary string from the current text info,
i = FindString(line, chr(10)) // find its carriage return positon,
line = mid(line, 1, i) // change the string to what ever info the previous 2 lines produced
tempTextObject = CreateText(line) // and then create a temporary text object with that info.
SetTextSize(tempTextObject, GetTextSize(textInfo))
height = GetTextTotalHeight(tempTextObject)
DeleteText(tempTextObject)
endfunction height
function UpdateTextInfo()
ScrollTextUp(2.5)
endfunction
// Just text from a file that's part of another project,
// it's the only large amount of text lines I could find on my HDD.
Info:
AddTextInfoLine("// Your source images go here:")
AddTextInfoLine("AddImage GameBackground, Images\GameBackground.png")
AddTextInfoLine("AddImage GameBorder, Images\GameBorder.png")
AddTextInfoLine("AddImage LevelComplete, Images\LevelComplete.png")
AddTextInfoLine("AddImage Squares, Images\Sprites1.png")
AddTextInfoLine("AddImage Player, Images\Player1.png")
AddTextInfoLine("AddImage Particle, Images\Particle.png")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("// Create your sprites and add animation frames here:")
AddTextInfoLine("CreateSprite GameBackground")
AddTextInfoLine("AddSpriteFrame GameBackground, GameBackground, 0, 0, 200, 100")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite GameBorder")
AddTextInfoLine("AddSpriteFrame GameBorder, GameBorder, 0, 0, 1, 1")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite GameBorderLine")
AddTextInfoLine("AddSpriteFrame GameBorderLine, GameBorder, 1, 0, 1, 1")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite LevelComplete")
AddTextInfoLine("AddSpriteFrame LevelComplete, LevelComplete, 0, 0, 180, 68")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite SquareEmpty")
AddTextInfoLine("AddSpriteFrame SquareEmpty, Squares, 0, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite SquareSilver")
AddTextInfoLine("AddSpriteFrame SquareSilver, Squares, 22, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite EndPoint")
AddTextInfoLine("AddSpriteFrame EndPoint, Squares, 44, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame EndPoint, Squares, 66, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame EndPoint, Squares, 88, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite DeflectorTopLeft")
AddTextInfoLine("AddSpriteFrame DeflectorTopLeft, Squares, 0, 22, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite DeflectorTopRight")
AddTextInfoLine("AddSpriteFrame DeflectorTopRight, Squares, 22, 22, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite DeflectorBottomLeft")
AddTextInfoLine("AddSpriteFrame DeflectorBottomLeft, Squares, 44, 22, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite DeflectorBottomRight")
AddTextInfoLine("AddSpriteFrame DeflectorBottomRight, Squares, 66, 22, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite Player")
AddTextInfoLine("AddSpriteFrame Player, Player, 0, 0, 99, 99")
AddTextInfoLine("AddSpriteFrame Player, Player, 99, 0, 99, 99")
AddTextInfoLine("AddSpriteFrame Player, Player, 198, 0, 99, 99")
AddTextInfoLine("AddSpriteFrame Player, Player, 297, 0, 99, 99")
AddTextInfoLine("AddSpriteFrame Player, Player, 396, 0, 99, 99")
AddTextInfoLine("AddSpriteFrame Player, Player, 495, 0, 99, 99")
AddTextInfoLine("AddSpriteFrame Player, Player, 396, 0, 99, 99")
AddTextInfoLine("AddSpriteFrame Player, Player, 198, 0, 99, 99")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite PlayerOverlay")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 0, 100, 99, 99")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 99, 100, 99, 99")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 198, 100, 99, 99")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 297, 100, 99, 99")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 396, 100, 99, 99")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 297, 100, 99, 99")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 198, 100, 99, 99")
AddTextInfoLine("AddSpriteFrame PlayerOverlay, Player, 99, 100, 99, 99")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("//CreateSprite PlayerPop")
AddTextInfoLine("//AddSpriteFrame PlayerPop, Player, 0, 250, 242, 280")
AddTextInfoLine("//AddSpriteFrame PlayerPop, Player, 260, 250, 242, 280")
AddTextInfoLine("//AddSpriteFrame PlayerPop, Player, 520, 250, 242, 280")
AddTextInfoLine("//AddSpriteFrame PlayerPop, Player, 780, 250, 242, 280")
AddTextInfoLine("//AddSpriteFrame PlayerPop, Player, 1041, 250, 242, 280")
AddTextInfoLine("//AddSpriteFrame PlayerPop, Player, 1301, 250, 242, 280")
AddTextInfoLine("//AddSpriteFrame PlayerPop, Player, 1561, 250, 242, 280")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite Particle")
AddTextInfoLine("AddSpriteFrame Particle, Particle, 0, 0, 3, 3")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite Cannon")
AddTextInfoLine("AddSpriteFrame Cannon, Squares, 132, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame Cannon, Squares, 154, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite CannonPlasma")
AddTextInfoLine("AddSpriteFrame CannonPlasma Squares, 177, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite SparkGap")
AddTextInfoLine("AddSpriteFrame SparkGap, Squares, 200, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite Spark")
AddTextInfoLine("AddSpriteFrame Spark, Squares, 223, 23, 23, 23")
AddTextInfoLine("AddSpriteFrame Spark, Squares, 246, 23, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite Spikes")
AddTextInfoLine("AddSpriteFrame Spikes Squares, 88, 22, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite LaserCannon")
AddTextInfoLine("AddSpriteFrame LaserCannon, Squares, 338, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserCannon, Squares, 361, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserCannon, Squares, 384, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserCannon, Squares, 407, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite LaserBeamHorizontal")
AddTextInfoLine("AddSpriteFrame LaserBeamHorizontal, Squares, 269, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserBeamHorizontal, Squares, 292, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserBeamHorizontal, Squares, 315, 0, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserBeamHorizontal, Squares, 292, 0, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateSprite LaserBeamVertical")
AddTextInfoLine("AddSpriteFrame LaserBeamVertical, Squares, 269, 23, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserBeamVertical, Squares, 292, 23, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserBeamVertical, Squares, 315, 23, 23, 23")
AddTextInfoLine("AddSpriteFrame LaserBeamVertical, Squares, 292, 23, 23, 23")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("// Create game object library entries and add sprites to them here:")
AddTextInfoLine("CreateGameObject 00, Void")
AddTextInfoLine("AddSpriteToGameObject 00, SquareEmpty, Empty, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject SS, Solid")
AddTextInfoLine("AddSpriteToGameObject SS, SquareSilver, Silver, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject EP, Void")
AddTextInfoLine("AddSpriteToGameObject EP, EndPoint, End, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject PL, Solid")
AddTextInfoLine("AddSpriteToGameObject PL, Player, Player, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject PL, Solid")
AddTextInfoLine("AddSpriteToGameObject PL, Player, Player, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject PLOverlay, Solid")
AddTextInfoLine("AddSpriteToGameObject PLOverlay, PlayerOverlay, PlayerOverlay, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject TL, TL")
AddTextInfoLine("AddSpriteToGameObject TL, DeflectorTopLeft, TL, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject TR, TR")
AddTextInfoLine("AddSpriteToGameObject TR, DeflectorTopRight, TR, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject BL, BL")
AddTextInfoLine("AddSpriteToGameObject BL, DeflectorBottomLeft, BL, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject BR, BR")
AddTextInfoLine("AddSpriteToGameObject BR, DeflectorBottomRight, BR, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject Cannon, Cannon")
AddTextInfoLine("AddSpriteToGameObject Cannon, Cannon, Cannon, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject CannonPlasma, Plasma")
AddTextInfoLine("AddSpriteToGameObject CannonPlasma, CannonPlasma, CannonPlasma, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject SparkGap, Zapper")
AddTextInfoLine("AddSpriteToGameObject SparkGap, SparkGap, SparkGap, 0, 0")
AddTextInfoLine("AddSpriteToGameObject SparkGap, SparkGap, SparkGap, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject Spark, Spark, Zapper")
AddTextInfoLine("AddSpriteToGameObject Spark, Spark, Spark, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject Spikes, Spikes, Killer")
AddTextInfoLine("AddSpriteToGameObject Spikes, Spikes, Killer, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject TripBlock, TripBlock")
AddTextInfoLine("AddSpriteToGameObject TripBlock, SquareSilver, Block, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("CreateGameObject LaserCannon, LaserCannon")
AddTextInfoLine("AddSpriteToGameObject LaserCannon, LaserCannon, Cannon, 0, 0")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("")
AddTextInfoLine("// Add sounds here:")
AddTextInfoLine("AddSound Spark, Sounds\SFX\Spark.ogg")
AddTextInfoLine("AddSound Laser, Sounds\SFX\Laser.ogg")
AddTextInfoLine("AddSound Plasma, Sounds\SFX\Pew.ogg")
AddTextInfoLine("AddSound Pop, Sounds\SFX\Pop.ogg")
AddTextInfoLine("AddSound SpikeOut, Sounds\SFX\SpikeOut.ogg")
AddTextInfoLine("AddSound SpikeIn, Sounds\SFX\SpikeIn.ogg")
AddTextInfoLine("AddSound ToggleBlockOn, Sounds\SFX\ToggleBlockOn.ogg")
AddTextInfoLine("AddSound ToggleBlockOff, Sounds\SFX\ToggleBlockOff.ogg")
AddTextInfoLine("AddSound GameOver, Sounds\SFX\GameOver.ogg")
AddTextInfoLine("")
return