locked
XAML - Class-Based Changing Text in Separate Rectangles RRS feed

  • Question

  • I am having numerous rectangles being used to represent different players in a game.

    Each rectangle, I thought, would display all information needed.  They would disappear and reappear as you use them on the battlefield or send them back to the barracks.

    The rectangles would display their names, but also their current health, power and other statistics.

    I'm creating this in XAML and DirectX with C++, because it sounds like DirectX has better flow when running the program and because the XAML screen provides a preview.

    ...Do I write code for the text in the XAML Designer, or create a "Players" class and provide all information there?  I was going to use TextBlocks.

    Saturday, October 24, 2015 8:11 PM

Answers

  • Hi RedGuy:

    Yes. You can just write code in XAML designer. There are animations built into some of the Windows Runtime controls, as part of their control logic and default XAML templates. We recommend that you get to know these controls so that you can use them for your animations in UI. You can also create your own animation by using  a storyboarded animation. On MSDN, you can find a tutorial about animation UI using XAML.

    For more sample code about developing UWP game, you can refer to GitHub.

    Please let me know if this can help.

    • Proposed as answer by chchlll Monday, November 2, 2015 8:49 AM
    • Marked as answer by Shu 2017 Tuesday, November 3, 2015 2:00 AM
    Monday, October 26, 2015 7:35 AM