Menu

Customise display colors

Anonymous
2017-09-10
2017-09-10
  • Anonymous

    Anonymous - 2017-09-10

    Hi all,

    since my board is working now ! (on the 1.0.0 version) I wonder how to change the transparency factor of the displays ?
    I found the colors settings in the config.py file, but if I add a new color in RGBA, playng on the 'A' factor, the display ttransparency doesn't change..

    for example :

    1. in config.py
      I create a color named 'cblack' for crystal_black
    'cblack': (0, 0, 0, 0.9), #crystal black RGBA
    
    1. in the DisplayRound in CScreen.py
      I try to have a black glass effect on the Round counter (@l ine 1920 in the original file I changed the color to 'cblack' )
     def DisplayRound(self,Round,TotalRound): 
    (...)
          #Display
          self.BlitRect(X,Y,SX,SY,self.ColorSet['cblack'])
          self.BlitRect(X,Y,SX,Th,self.ColorSet['white'])
    (...)
    

    Despite the modification of the fourth factor in the color code, nothind happend.

    I think I have missed a parameter somewhere but i did'nt ffind it, can someone please help me ?

    dartly yours ;)

    POULOPOP

     

    Last edit: Anonymous 2017-09-10
  • poilou

    poilou - 2017-09-11

    Hi Poulolop !
    Unfortunately, the Alpha (transparency) is not supported by pydarts yet. You can blame pygame, the underlying component of pydarts. It support trnasparency (I use it on boxes), but it's painful to implement. So I did not code transparency for text, whichwould be really hard.

    My suggestion, why don't you use a greyscale instead of a transparent black ?

    Well done for your board anyway !

     

    Last edit: poilou 2017-09-11
  • Anonymous

    Anonymous - 2017-09-11

    Hi Poulolop !
    I misread your question.
    To use alpha on BlitRect method, use the Alpha setting :

    BlitRect(self,X,Y,SX,SY,Color,Border=False,BorderColor=False,Alpha=None):
    

    Exemple :

    self.BlitRect(X,Y,SX,SY,self.ColorSet['cblack'],False,False,0.9)
    

    And you're done !
    Cheers

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.