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

Can't get $dragon.gridlines! to work

A topic by amignosis created Oct 27, 2019 Views: 444 Replies: 4
Viewing posts 1 to 2
(1 edit)

I am following the free tutorial over at DragonRuby School. There are some instructions to type <kbd>:</kbd> and then `$dragon.gridlines!`. However, that does not work. What am I missing? If I type ` to bring up the console, that doesn't work there either.

Developer (1 edit) (+1)

That api has been removed (it was really only useful for a small set of games). If you want to create gridlines try this:

def gridlines!
  args = $gtk.args
  args.state.show_gridlines = !$gtk.args.state.show_gridlines
  if args.state.show_gridlines && args.outputs.static_lines.length == 0
    args.outputs.static_lines << 80.times.map do |i|
      [
        [i * 16,      0, i * 16,    720, 128, 128, 128],
        [     0, i * 16,   1280, i * 16, 128, 128, 128],
      ]
    end
  elsif !args.state.show_gridlines
    args.outputs.static_lines.clear
  end
end

Then you can bring up the heads up display and run grindlines! and press enter.

Also! Come to the Discord channel if you have questions (lots of people there to help): http://discord.dragonruby.org.

(+1)

My two cents -> it would be helpful if this deprecation were mentioned at the applicable video on dragonruby.school.

Also would be helpful if this was mentioned in the CHANGELOG. I'm super impressed with DragonRuby so far, but trying to hunt down this specific forum thread was a weird first user experience for me!

Developer(+1)

Lori is working on revamping the videos. And depreciation notices will be added. Be sure to join the discord!