How to Anchor widget to right of screen without any overhang. Kivy Python

Viewed 34
<GeneratorScreen>:
BoxLayout:
    orientation:'vertical'
    size: root.width, root.height

    AnchorLayout:
        anchor_x: "right"
        anchor_y: "top"
        size: 300, root.height
        BoxLayout:
            orientation:'vertical'

            GridLayout:
                size_hint: None, None
                pos_hint: {'x': .9, 'y': .9}
                size:200, 200
                cols: 3

                Button:
                    id: settlement_button
                    text: 'Settlement'
                    font_size: 10
                    pos_hint: {'x': .901, 'y': .87}
                    size_hint: None, None
                    size: 67, 20
                    on_press: root.test()

                Button:
                    id: npc_button
                    text: 'Npc'
                    font_size: 10
                    pos_hint: {'x': .93, 'y': .87}
                    size_hint: None, None
                    size: 67, 20 

                Button:
                    id: npc_button
                    text: 'Store'
                    font_size: 10
                    pos_hint: {'x': .93, 'y': .87}
                    size_hint: None, None
                    size: 67, 20 

                Button:
                    id: npc_button
                    text: 'other'
                    font_size: 10
                    pos_hint: {'x': .93, 'y': .87}
                    size_hint: None, None
                    size: 67, 20 

I am trying to anchor some widget to the right side of a window even when the window is resized. There is runoff on the sides where the buttons run off screen. How do I prevent that from happening? buttons off screen also buttons off screen different window size

1 Answers
Related