Go to advanced search

by AshPowers
Wed May 10, 2017 5:12 am
Forum: Python
Topic: pi3d: TextBlock data input failure
Replies: 1
Views: 177

Re: pi3d: TextBlock data input failure

Problem Solved:

The issue is in the formatting within the TextBlock definition. Characters coming from the phone are strings and the formatting in the TextBlock was expecting integer values.

text_format="{:4.0f}", size=0.50, spacing="C", space=.7,
by AshPowers
Wed May 10, 2017 2:46 am
Forum: Python
Topic: pi3d: TextBlock data input failure
Replies: 1
Views: 177

pi3d: TextBlock data input failure

... default uses the UTF-8 encoding as well. class EgClass(object): pterm = 0 eg_object = EgClass() BACKGROUND_COLOR = (0.0, 0.0, 0.0, 1.0) DISPLAY = pi3d.Display.create(background=BACKGROUND_COLOR) HWIDTH, HHEIGHT = DISPLAY.width / 2.0, DISPLAY.height / 2.0 QWIDTH = HWIDTH/2 # quarter width shader ...
by paddyg
Tue May 09, 2017 7:25 am
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1390

Re: try: except: else: not acting right at all!!

You could use one loop, putting your pi3d stuff in your serial reading loop or vice-versa but you would then need to make sure you didnt have any blocking reads or long sleeps. you would call loop_running() in the loop (ie it doesn't have to ...
by AshPowers
Tue May 09, 2017 12:43 am
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1390

Re: try: except: else: not acting right at all!!

If you look at the bottom of the code snippet I write, you will see the while DISPLAY.loop_running():. This is for pi3d and once the program gets to this loop, it runs in this loop forever, continually redrawing the screen. This is also where all of my data acquisition is occuring ...
by Douglas6
Tue May 09, 2017 12:14 am
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1390

Re: try: except: else: not acting right at all!!

I'm afraid I'm not familiar with Pi3d and it's display loop(?). You might need a separate thread, and/or a hook into the UI loop, if that's what it is.
by AshPowers
Mon May 08, 2017 11:31 pm
Forum: Python
Topic: try: except: else: not acting right at all!!
Replies: 30
Views: 1390

Re: try: except: else: not acting right at all!!

... for only around that timespan again. So I have tested your code in a new blank file and it works just as intended. Only issue is that I am using pi3d and the while DISPLAY.loop_running(): is running, that is where the entirety of the program runs in. I have been trying to figure out how to use ...
by AshPowers
Sat May 06, 2017 9:11 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 397

Re: pi3d - Sprites laying over textblock????

... the issue. Another ID ten T error. :P But it is good to know about the maximum number of characters parameter. The 13 character value used in the pi3d example fortunately is large enough to hold each of the data values so it never became an issue.. Lucky me! HA! :) Thanks again!
by paddyg
Sat May 06, 2017 8:35 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 397

Re: pi3d - Sprites laying over textblock????

Ash, I can't think of a specific limit for the number of TextBlocks you can add to one PointText object. In pi3d_demos.StringMulti.py there are 13 and it seems to work OK when I add several more. However when you create the PointText you have to specify the maximum number of ...
by AshPowers
Sat May 06, 2017 6:59 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 397

Re: pi3d - Sprites laying over textblock????

... feedback! Yes, I did get things sorted out with the bluetooth connection. Silly oversight on my part. However, I have come across something with pi3d again... Is there a limit to how many textblock items you can create? It seems that it will only allow 10. I've tried every way, and sideways, ...
by paddyg
Sat May 06, 2017 4:28 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 397

Re: pi3d - Sprites laying over textblock????

That dashboard looks amazing, it's really uplifting to see the stuff people do with the Raspberry Pi, especially if they've not been coding long (three weeks of python is very little to be fixing things like this). On your serial try catch question. You've probably sorted it out from douglas and dav...
by AshPowers
Sat May 06, 2017 12:43 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 397

Re: pi3d - Sprites laying over textblock????

Hi Paddy! I feel a bit starstruck! I've seen SO many of your posts since picking up this RPi3 three weeks ago and all of the searches I've done while picking up Python - immensly helpful!. :) I have been on this project some 200+ hours already in that time and over 300 lines of solid code in this au...
by paddyg
Sat May 06, 2017 12:42 pm
Forum: Python
Topic: pi3d font definitions killing background
Replies: 2
Views: 265

Re: pi3d font definitions killing background

64 seems to be the most capricious GPU setting as sometimes it works and sometimes it doesn't. Changing a host of things can stop rendering - there should be a logger message now (as of v2.19) I haven't had an issue with 128
by paddyg
Sat May 06, 2017 9:42 am
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 397

Re: pi3d - Sprites laying over textblock????

@AshPowers, thanks for struggling on with various pi3d quirks; I will add them to the FAQ for the sake of others. The lack of GPU memory symptoms are so varied they're quite hard to figure out, especially if you're just getting to grips with a new ...
by AshPowers
Fri May 05, 2017 6:35 pm
Forum: Python
Topic: pi3d - Sprites laying over textblock????
Replies: 6
Views: 397

pi3d - Sprites laying over textblock????

pi3d.textblock is being "overdrawn" by pi3d.imagesprite text is actually on the screen, behind the "background" sprite that takes up the entire display area. Other sprites are showing up along with the background sprite. When ...
by AshPowers
Fri May 05, 2017 6:18 pm
Forum: Python
Topic: pi3d font definitions killing background
Replies: 2
Views: 265

Re: pi3d font definitions killing background

Problem was memory allocation. The default of 64MB for the GPU was not enough. I thought I had already bumped it up!

Menu-Rasbberry pi configuration - performance - GPU memory: set to 256
by AshPowers
Tue May 02, 2017 3:22 am
Forum: Python
Topic: pi3d font definitions killing background
Replies: 2
Views: 265

pi3d font definitions killing background

... need to be in white. There is a background image of a gauge cluster which has moving needles, digital values, etc. When I make a call to a second pi3d.Font definition for a white color text, the background image no longer appears. Program runs just fine, but all you see are a bunch of analog needles ...
by AshPowers
Mon May 01, 2017 9:50 pm
Forum: Python
Topic: pi3d string text color ??
Replies: 2
Views: 230

Re: pi3d string text color ??

Actually figured it out a few hours after posting.

You can change the text color of a string in the font definition.

Code: Select all

myfont = pi3d.Font('fonts/fontname.ttf', (x, x, x, a))
x,x,x = RGB and the a value is alpha.
by scotty101
Sun Apr 30, 2017 10:08 pm
Forum: Python
Topic: pi3d string text color ??
Replies: 2
Views: 230

Re: pi3d string text color ??

Looks like you can change colour with TextBlock

https://pi3d.github.io/html/pi3d.util.h ... .TextBlock

And you can change String colour by defining the colour of the font used

https://pi3d.github.io/html/pi3d.util.h ... .util.Font
by AshPowers
Sun Apr 30, 2017 7:55 pm
Forum: Python
Topic: pi3d string text color ??
Replies: 2
Views: 230

pi3d string text color ??

Hi,

Having issues with trying to change the color of the text put on the screen using pi3d.String.

Cannot seem to find any documentation on how to do this. It is limited to just white characters??

Thanks!
-Ash
by paddyg
Fri Apr 28, 2017 10:56 pm
Forum: Python
Topic: imports 2 to 3
Replies: 4
Views: 346

Re: imports 2 to 3

in pi3d we used the six module functions so the code gets converted 'on the fly' which means the same code runs with py2 or py3 (and pypy) However there is a small processing cost for doing this. You *could* patch the 'wrong' ...
by paddyg
Tue Apr 25, 2017 2:06 pm
Forum: Python
Topic: pypy with numpy
Replies: 1
Views: 252

pypy with numpy

I've just been checking out the progress of pypy (specifically whether or not pi3d will 'just' work with it now) On ubuntu it was surprisingly straightforward and worked very well, just four numpy functions missing (that had little impact). On the Raspberry Pi, ...
by Cigano1434
Mon Apr 24, 2017 6:48 pm
Forum: Python
Topic: Pi3D AssertionError on all demos
Replies: 18
Views: 754

Re: Pi3D AssertionError on all demos

Paddy, Thanks for the update and the fixes. I had noticed the console issue, but I was tackling one issue at a time. Thanks for the information on the Context. I will be using that from now on, even though I am only using the keyboard for debug purposes as this app will have no keyboard input. :) Ja...
by kusti8
Mon Apr 24, 2017 3:08 pm
Forum: General discussion
Topic: which 3d game engine??
Replies: 3
Views: 354

Re: which 3d game engine??

Pi3D should work since it uses OpenGLES. AFAIK it works pretty well for others.
by paddyg
Sat Apr 22, 2017 9:24 pm
Forum: Python
Topic: Pi3D AssertionError on all demos
Replies: 18
Views: 754

Re: Pi3D AssertionError on all demos

As a quick post script - I have added LOGGER.critical('Out of GPU memory') to Texture and altered pi3d.Log so that it uses the root logger (reverted as it did this already if no name argument given). Now if you create a pi3d.Log object before the Texture is created then ...
by paddyg
Sat Apr 22, 2017 11:34 am
Forum: Python
Topic: Pi3D AssertionError on all demos
Replies: 18
Views: 754

Re: Pi3D AssertionError on all demos

... the example program closes it leaves curses in an annoying state as there is no Keyboard.close() after the break. See here for suggestions. Also pi3d has a wrapper for the python logger so you can simply do LOGGER = pi3d.Log(level='INFO', file='test.log') LOGGER.info('display size: {} x {}'.format(display.width, ...

Go to advanced search