Class GView¶
This is the class that you will use to draw shapes to the screen. Simply pass an
instance of this class to the draw
method in GObject.
You must do this every animation frame, as the game is constantly clearing the window.
You should never construct an object of this class. Creating a new instance
of this class will not properly display it on the screen. Instead, you should
only use the one provided in the input
attribute of GameApp. See that class
for more information.
Constructor¶
-
class
game2d.
GView
¶ Creates a new view for display
This constructor does very little. It does not hook up the view to the game window. That functionality happens behind the scenes with hidden methods. You should only use use the object provided in the view attribute of
GameApp
. See the documentation of that class for more information.
Methods¶
-
GView.
draw
(cmd)¶ Draws the given Kivy graphics command to this view.
You should never call this method, since you do not understand raw Kivy graphics commands. Instead, you should use the draw method in
GObject
instead.- Parameters
cmd (A Kivy graphics command) – the command to draw
-
GView.
clear
()¶ Clears the contents of the view.
This method is called for you automatically at the start of the animation frame. That way, you are not drawing images on top of one another.