irskep / clubsandwich Goto Github PK
View Code? Open in Web Editor NEWA BearLibTerminal framework for Python 3
License: MIT License
A BearLibTerminal framework for Python 3
License: MIT License
Otherwise text fields have some trouble.
When implementing an actual game, you might want to let the "game view" handle all screen updates.
ScrollingTextView
KeyAssignedListView
Pickling Point instances, and unpickling them in a different python session, leads to a malfunctioning Point class on Python>=3.3. More specifically, its _hash member value is different from what a new identical Point would generate in this session. A way to reproduce it would be to pickle a dictionary with Points as keys, save result to a file, and then unpickle this file in a different python session and try to access the keys - dictionary would almost certainly return nothing.
The underlying issue is that starting with Python 3.3, the built-in hash() function returns results that are randomized across different python sessions: https://github.com/irskep/clubsandwich/blob/master/clubsandwich/geom.py#L33
Hello,
Python version : 3.7
Pip version: 18.1
OS: Windows 7
When trying to install the library using the supplied command pip install -e 'git://github.com/irskep/clubsandwich.git@master#egg=clubsandwich'
, there's an error:
'git://github.com/irskep/clubsandwich.git@master#egg=clubsandwich' should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+
It works when we delete the quotes, the final command being
pip install -e git://github.com/irskep/clubsandwich.git@master#egg=clubsandwich
It should use color_bg and color_fg as the colors for the label, and invert when selected.
This ticket exists to let you know that it's not happening.
You can see this by pressing backslash on the ui.py example file. Note that this occurs with some things like buttons, too, since they contain a label.
Removing the debug_string definition from misc_views.LabelView resolves the issue.
[color=red]Hello
makes Label think that the string is 11 characters long.
Hello! I have been using BLT for my roguelike project, and I wanted to give ClubSandwich a try. I was replacing some of my existing code with the examples used in the README, and maybe I'm doing something wrong, but I wanted to see what was up with this.
Here is what I have in my code:
class MainMenuScene(Scene):
def terminal_update(self, is_active=False):
print(0, 0, "Press Enter to begin the game, ESC to quit.")
def terminal_read(self, val):
if val == terminal.TK_ENTER:
self.director.push_scene(GameScene())
elif val == terminal.TK_ESCAPE:
self.director.pop_scene()
class GameScene(Scene):
def terminal_update(self, is_active):
return super().terminal_update(is_active=is_active)
def terminal_read(self, char):
return super().terminal_read(char)
class Director(DirectorLoop):
def get_initial_scene(self):
return MainMenuScene()
On extended DirectorLoop
, making a MainMenuScene
subclass of Scene
, and attempting to run it, instead of the expected behavior I get a NotImplementedError
being raised. Here's the traceback:
Traceback (most recent call last):
File "./anathema/main.py", line 12, in <module>
main()
File "./anathema/main.py", line 8, in main
game.start()
File "/home/krummja/Workspace/Python/Anathema/anathema/core/game.py", line 89, in start
self.loop()
File "/home/krummja/Workspace/Python/Anathema/anathema/core/game.py", line 106, in loop
DirectorLoop().run()
File "/home/krummja/Workspace/Python/Repositories/src/clubsandwich/clubsandwich/blt/loop.py", line 77, in run
self.terminal_init()
File "/home/krummja/Workspace/Python/Repositories/src/clubsandwich/clubsandwich/director.py", line 165, in terminal_init
self.replace_scene(self.get_initial_scene())
File "/home/krummja/Workspace/Python/Repositories/src/clubsandwich/clubsandwich/director.py", line 153, in get_initial_scene
raise NotImplementedError()
NotImplementedError
Let me know if you need any other information, and I'm happy to provide it. If I'm missing something obvious, of course, please do let me know as well!
I found an error with The Scene example on the website. I changed a thing to make it work but have no clue if I borked it or not.
OLD CODE
def terminal_update(self):
i = 0
for j, scene in enumerate(self.scene_stack):
if scene.covers_screen:
i = j
for scene in self.scene_stack[i:]:
scene.terminal_update(scene == self.scene_stack[-1]) #THIS PRODUCES AN ERROR
return not self.should_exit
MY JANKY ATTEMPT
def terminal_update(self):
i = 0
for j, scene in enumerate(self.scene_stack):
if scene.covers_screen:
i = j
for scene in self.scene_stack[i:]:
scene = self.scene_stack[-1]#<=== EDITED THIS
scene.terminal_update()
return not self.should_exit
That said, it now works but no clue if I ruined any other features.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.