Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

DragonRuby Game Toolkit

An intuitive 2D game engine. Fast, cross-platform, tiny, hot loaded. · By DragonRuby

Bug with String[index, length] ?

A topic by Krazplay created Aug 01, 2020 Views: 225 Replies: 1
Viewing posts 1 to 2

Hi,
I'm playing with dragonruby and I don't know if it's only me, but I've an annoying bug when trying to display a part of a string:

@abc = "Hello world, 01234567890123456789"
args.outputs.labels << [10,120, @abc[0,23]]
args.outputs.labels << [10, 90, @abc[0,24]]

First output works fine, showing 23 characters: "Hello world, 01234567890"
But the second output will always show ALL the characters, as soon as you try to return 24 characters or more the whole string is returned. You can try with a range @abc[0...24] the result is the same.

Can someone try this to check if it's only on my side ?
I was doing a window showing a message letter by letter, but when my index reach 24 the whole line is displayed at once :(

That is a known bug - the workaround is to use string constants or interpolation.