Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tapeworm711

Pages: [1]
1
Programming / Re: Screen Not Refreshing upon Menu Close
« on: January 29, 2017, 07:19:58 AM »
Sorry. That was pastebin.com.

Stupid phone keyboard.

2
Programming / Re: Screen Not Refreshing upon Menu Close
« on: January 29, 2017, 05:25:36 AM »
You could start a github just got that. If the code is one file you could also use http://pastebin.com

3
Programming / Re: Screen Not Refreshing upon Menu Close
« on: January 29, 2017, 01:52:49 AM »
It could be a copy-paste error.

But the last three lines of your inventory code appear to be unreachable. Which is where your clear and FOV update code is.

4
https://github.com/joekane/bltColor


bltColor

A color Class for BearLibTerminal that adds libtcod-like color functions.

Features:
  • Set alpha of a color.
  • Multiply by float.
  • Multiply two colors.
  • Add two colors.
  • Subtract two colors.
  • Blend two colors with a bias.
  • Generate a custom gradient using color_map

This class is fully compatible with any function that BLT wants a color parameter, including [color] formatting tags.

5
Not sure how I missed that. Thanks.

6
Found an odd issue with   [wrap] / [align] tags.

If you install BearLibTerminal via pip. The tags do NOT function properly. As in they do not no aligning or wrapping at all.

BUT

If you use PyBearLibTerminal and BearLibTerminal.dll from the "blt-samples" master, they work just fine.

Is there an issue with the PIP package? or am I doing something wrong?

P.S. Really close to finishing a python class called "bltColor" that brings all the libtcod color functions to blt and more! (testing this is how I discovered the wrap issue)

7
When terminal.read_str() accepting input from the keyboard, is there a way to allow the use of the NUMPAD numbers? Cannot seem to enable this.

Thanks, as always.

8
Figured it out.

I had two different functions polling for inputs. So each mouse event was registering in each one. Fixed that and VOILA!.


9
More mouse questions:

I'm having trouble with differentiating between mouse clicks.

Example:
1) User presses key to open a Pop-Up window with a 'close' button.
2) User clicks on 'close' button with mouse.
3) Game closes Pop-Up, but also attempts to Pathfind to X, Y location (also activated by clicking)

Since I don't see a "TK_MOUSE_LEFT_UP" or "TK_MOUSE_LEFT_RELEASED". I tried using TK_MOUSE_CLICKS but that still shows 'True' while its being held. which is being seen by my other event handlers.

In addition to this issue it appears there is no state difference between HOLDING down a button and CLICKING IT rapidly (well you would get an occasional False from MOUSE_LEFT, but not sure if thats useful in this case).

10
The use case was for ranged combat:


User pressed "f" to enter Fire-Mode.
Program figures out closest targetable monster.
Reticle is placed over that monster.
If user presses "f" mode, targets will cycle between those available.
But use can "free-aim" by using the mouse, when user moves mouse reticle and firing line follows mouse in circle.
(NOTE: it felt more natural to move the cursor to the reticle than to have it just follow relatively. This was a minor thing, so I took it out)


NOTE: in the python bindings i'm using: TK_MOUSE_MOVE state is ALWAYS 0. (using check, its always False. Found that odd. all other mouse states appear to be working correctly.

Additionally i'm not sure how to get bearlib to read the "box drawing acsii" from my PNG file instead of the default. Even using your yoshi_island font the boxes draw standard when addressing them via unicode (ex: 0x2502 prints a |, regardless of the glyph in the .PNG)

Enjoy my barrage of ?'s!!

11
That clear function solved my issue. Its not the prettiest solution, but it works for now as there appears to be no noticeable input loss from the user.

It might have something to do with how time/turns are handled in my scheduler func.

Thanks for the quick reply!

Also:
Is there a way to write to the states?

For example if I want to move the mouse cursor to a cell with a line of code.
in libtcod there is:
Code: [Select]
libtcod.mouse_move(x, y)

that moves it to certain pixel coords.

12
I'm converting a project from libtcod to bearlibterminal because of various features I liked. Everything seems to be going well except for keyboard inputs. It appears as though an extremely large buffer of input commands are being kept when a user holds down a key. Is there a way to avoid this behavior? or to delete the queue on demand?

Ive tried using the non-blocking terminal.has_input() prior to calling terminal.return. But i get the same input lag no matter how I do it.

Code: [Select]
def read_key_int():
    while terminal.has_input():
        return terminal.read()
    return None

Any help would be greatly appreciated.

Thanks!

Pages: [1]