Code Monkey home page Code Monkey logo

Comments (7)

HexDecimal avatar HexDecimal commented on May 20, 2024

I can't reproduce this on Windows. I speculate that the issue might be caused by sleeping rather than waiting for an event.

You could try replacing the sleep with tcod.console_wait_for_keypress(False).

If that doesn't work then you could use a different renderer for tcod.console_init_root such as tcod.RENDERER_OPENGL2, renderers are listed here.

The tcod.FONT_LAYOUT_ASCII_INROW flag is wrong and will be removed.

from python-tcod.

SpaceCadetEve avatar SpaceCadetEve commented on May 20, 2024

I need to make a correction (I’ve been trying a handful of things to see what works).
When I run what is on that page, and I run “python3 engine.py”, it never shows a screen at all.

I used a modified version of the code at http://www.rogueliketutorials.com/libtcod/1

`import tcod

def main():
screen_width = 80
screen_height = 50

tcod.console_set_custom_font(
    'dejavu16x16_gs_tc.png',
    tcod.FONT_TYPE_GRAYSCALE | tcod.FONT_LAYOUT_TCOD,
)

root_console = tcod.console_init_root(screen_width, screen_height, 'tcod tutorial revised', False)

while True:
    root_console.clear()

    root_console.print_(10,10, "hello, world")

    tcod.console_flush()

    key = tcod.console_check_for_keypress()

    if key.vk == tcod.KEY_ESCAPE:
        return True

`
When I run this, the screen shows up, but is black.

from python-tcod.

SpaceCadetEve avatar SpaceCadetEve commented on May 20, 2024

Oh, and I tried the different render modes and they either caused a crash (probably because those aren't available) or had the same effect

from python-tcod.

HexDecimal avatar HexDecimal commented on May 20, 2024

Your code looks correct.

Be sure to change the default background color, example: root_console.default_bg = (0,0,255) in case that gives you something other than a black background.

All renderer modes should work on a modern computer. If there's something in libtcod causing the issue then it'd be useful if I knew which renderers were crashing.

from python-tcod.

HexDecimal avatar HexDecimal commented on May 20, 2024

I've tracked the issue down to SDL2, version 2.0.9 fixes this issue, so I'll get it updated.

from python-tcod.

HexDecimal avatar HexDecimal commented on May 20, 2024

tcod 8.1.0 should fix the issue. SDL2's changelog was very specific:

Mac OS X:
* Fixed black screen at start on Mac OS X Mojave

from python-tcod.

SpaceCadetEve avatar SpaceCadetEve commented on May 20, 2024

I can verify that it is fixed in 8.1.1. Thanks!

from python-tcod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.