editor.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # THIS IS A SOURCE CODE FILE FROM I'M NOT EVEN HUMAN THE GAME.
  2. # IT COULD BE USED IN A DIFFERENT PIECE OF SOFTWARE ( LIKE A
  3. # DIFFERENT GAME ), BUT IT WAS ORIGINALLY WRITTEN FOR I'M NOT
  4. # EVEN HUMAN THE GAME.
  5. # THE DEVELOPERS OF THE GAME ARE : (C) J.Y.AMIHUD, AYYZEE AND
  6. # OTHER CONTRIBUTORS. THIS AND OTHER FILES IN THIS GAME,
  7. # UNLESS SPECIFICALLY NOTED, COULD BE USED UNDER THE TERMS OF
  8. # GNU GENERAL PUBLIC LICENSE VERSION 3 OR ANY LATER VERSION.
  9. import os
  10. import json
  11. # GTK module ( Graphical interface
  12. import gi
  13. gi.require_version('Gtk', '3.0')
  14. from gi.repository import Gtk
  15. import cairo
  16. from modules import ui
  17. from modules import world
  18. def layer(game):
  19. # Setting up a cairo layer
  20. surface = cairo.ImageSurface(cairo.FORMAT_ARGB32,
  21. game.current['w'],
  22. game.current['h'])
  23. layer = cairo.Context(surface)
  24. layer.set_antialias(cairo.ANTIALIAS_NONE)
  25. ui.color(game, layer, "#FFFFFF")
  26. ui.text(game, layer, game.worlds[game.settings["world"]]["title"],
  27. int(game.current["w"]/2), 5,
  28. align="center")
  29. world.draw(game, layer, 20, 20,
  30. game.current["w"]-30,
  31. game.current["h"]-50, grid=True)
  32. return surface