ControlColor?

Home Forums Creating VirtualGamepads ControlColor?

This topic contains 6 replies, has 2 voices, and was last updated by  PalmTime 6 years, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #678

    ratbuddy
    Member

    Everything in the xml makes sense to me except the color codes. Help?

    #679

    PalmTime
    Keymaster

    Hey, yeah, the two values that are a little bit “shady” are the label value for the font, the character is clearly non-intelligible unless you have the font 😉

    The other one is the color, this article explains it best :
    http://www.dotnetperls.com/color

    Basically the xml parser converts the color to a integer value for easy storage back and forth, I could have proceeded with keeping the ARGB separately and reconstruct them at run time, but felt like that was going to be a little too much, I kept it simple…

    for more explanation, see ToARGB() and FromARGB() :
    http://msdn.microsoft.com/en-us/library/system.drawing.color.toargb(v=vs.110).aspx
    http://msdn.microsoft.com/en-us/library/2zys7833(v=vs.110).aspx

    #703

    ratbuddy
    Member

    Got it, that’ll be easy enough to convert.

    Now, adding a new control type for buttons with a target area and shape defined by the dimensions of a transparent background png or gif.. Maybe even two image files, one for pressed and one for not pressed.. That’s not something I can do..

    <ControlBase xsi:type="ControlButtonCustomImage">
     <ControlLabelImage>./templates/gamename_image1.png</ControlLabelImage>
     <ControlPositionX>##</ControlPositionX>
     <ControlPositionY>##</ControlPositionY>
     <ControlShape>ImageDefined</ControlShape>
     <ControlSize>##</ControlSize>
     <ControlVisible>bool</ControlVisible>
     <ControlActionValue>Yay!</ControlActionValue>
    </ControlBase>
    

    🙂

    Asides from that.. Why UTF-32? Just for the large range of character values in the font to use as button graphics?

    #731

    PalmTime
    Keymaster

    Unfortunately not, every type of control has to be defined in code, right now, we’re using a type of controls that don’t add a lot intensively to the graphics, also bear in mind, we want them to be shareable to other users. But don’t worry, I understand the interest for such a feature 😉

    #732

    PalmTime
    Keymaster

    Regarding UTF-32, yeah mostly and the way the resources was expected to be in order to be parsed 😉

    #733

    ratbuddy
    Member

    Of course they must be defined in code, my xml example was a hint that such code would not go unappreciated 🙂

    edit: Sharing would be easy as supplying a zip that contains the template xml along with the required image files in a subfolder. I guess the images could be encoded inside the xml as well, but that’s not elegant as far as letting users modify templates.

    • This reply was modified 6 years, 4 months ago by  ratbuddy.
    #782

    PalmTime
    Keymaster

    Agreed. Eventually, I’d like to incorporate Cloud Sharing…

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.