Python Roguelike: Background Issue - python

I'm following a tutorial on making a roguelike in python, and it's actually coming along pretty nice. However, I have come to a small graphical issue: for the player and enemies, they all have a black background on them, which I don't want. I've tried changing the background to none anywhere I can, but I can't seem to figure out how to fix it. I'd really appreciate if anyone could help me out with this. Below is a link to an image showing this problem:
Also, if it helps, I'm using notepad++ and libtcod.
Thanks.

Hmm, you probably need to set the background flag. Or at least give it the proper color. So try to override it.
When you print a character it needs both foreground and background.
In any case you should probably look into object.draw() player.draw()

[SOLVED]
I found that I overlooked one of the parameters in the object.clear() event, and all I had to do was check if the object was visible, and if it has been explored yet to determine which background color to set it to.
Thanks to everyone who replied and gave their input!

Related

message that pops up while writing python code on vscode

I am not sure what it is actually called. I am a beginner. I am learning python and using VS Code as my code editor. But when I write codes the message in the red circle highlighted in the screenshot pops up. It's kind of annoying.
Can someone please help me with it? I don't know what it is called and would like to turn it off.
That pop up just shows the structure of the function you are using. It includes parameter hints.
In the image it is showing the structure of print function. It's a useful feature to be honest.
Press esc to cancel out of an individual popup, or set"editor.parameterHints.enabled": false to disable it entirely.
So, that box you have there is the documentation of the method you are calling. In this case, print(). It's actually quite useful. It'll give you a quick description of the parameters that you can pass into the function. For more confusing functions, the auto-documentation is a must have. But, of course, it is up to you.
You can disable it by setting "editor.parameterHints.enabled" to false in your .json
This is a function provided by VS Code to display information such as method parameters. You can turn it off in settings.
Click the gear icon in the lower left corner and select Settings,
then search for parameterhints, and uncheck the options in the picture.
In addition, as mentioned above, you can also add the following configuration to the settings.json file to achieve the same effect.
"editor.parameterHints.enabled": false

Window resolution in Tkinter

I know that this might sound weird, but I have a problem considering the screen resolution of my Tkinter program. I have attached two pictures for a comparison.
I think you can clearly tell, what I'm talking about. The problem is that I don't really know why this happened. Suddenly the tkinter window had a way better resolution as you can see in the top picture. I did not change anything related to screensize/resolution by myself and was therefore expecting Tkinter to have published an update which just has better textures for every widget.
But because I had to reinstall python and all its modules this is no longer the case and the widgets look very blurry again (Bottom picture). Now I'm asking myself whether this has something to do with another version of Python or tkinter I'm using or what else could have been the reason for that.
I did not change my PC, Screen or anything like that. I just reinstalled python and its modules. Sadly I don't have the source code of the version where it looked great, but only an .exe file, because im continuously updating my program. But as I said before, I don't know what I could have changed which led to this huge resolution improvement.
I hope you get, what I'm trying to tell you.
Thanks in advance!
I was able so solve it!
I had a look on this question: on Stackoverflow
The answer from #binaryfunt solved my problem completely. So it was not really a tkinter/python thing, but rather windows itself.

How Can i open a subwindow with pygame?

I need to make a sub window using The pygame package, I want to do two type of subwindow, the first fixed in of the window and the second type completely independent of the window.
While approaching this problem, be aware that two windows is pretty much impossible for Pygame, since it is dependent on SDL and SDL is limited to 1 screen.
Maayyybbe, you could run two different programs that have different windows and can interact with each other via some networking you set up. But at this point, you'd probably be better off coding in something else.
Making a sort of subwindow is doable by splitting up your screen, and to use parts of it for one thing, and others for something else. For example, you can blit images to this separate "window" that have totally different things going on than the stuff outside of it.
Also, please google before posting a question, a quick google search revealed Pygame with Multiple Windows, which answers half of your question.

Click automatically in specific points after recognition of text

I am using MATLAB and SIMULINK and there is something missing there that is driving me crazy, but the question is not MATLAB-related.
At a certain point I have a window like that:
I would like to have the SELECT ALL button. I don't know why, but since a lot of years I am asking this feature to MathWorks but they don't implement it.
Anyway, I decided to do a workaround by myself.
I want to make a small script in Python which detect the text 'Tunable' and after it clicks automatically on ALL the checkboxes.
Is it possible to do it in Python ?
I found a solution to my problem.
If you are interested you can look at it in this video:
VIDEO YOUTUBE
I am happy to share ideas and to know your opinion.

What kind of widget is this?

I am trying to make a widget exactly like this,
I want mine to be exactly the same (same font, picture, ect). Does anyone know how I can do this? I think it is a wx.ListCtrl but I cant find an example on how to make it look like this.
Can you provide me an example on how to make this widget?
Thanks.
It's a report list. Don't forget to keep a reference to the image list yourself since the bindings are stupid and don't incref it when you assign it to the list.
If the widget brings up different panels when you click on the image, then it's probably a Listbook, not a ListCtrl. Plus those are images from the wxPython demo for the Listbook AND the Toolbook AND the Treebook demos, so I'm guessing it's one of those.

Categories

Resources