Quick search

Table Of Contents

Context management

バージョン 1.2.0 で追加.

This class manages a registry of all created graphics instructions. It has the ability to flush and delete them.

You can read more about Kivy graphics contexts in the Graphics(翻訳中) module documentation. These are based on OpenGL graphics contexts.

class kivy.graphics.context.Context

ベースクラス: builtins.object

The Context class manages groups of graphics instructions. It can also be used to manage observer callbacks. See add_reload_observer() and remove_reload_observer() for more information.

add_reload_observer()

(internal) Add a callback to be called after the whole graphics context has been reloaded. This is where you can reupload your custom data into the GPU.

Parameters:
callback: func(context) -> return None

The first parameter will be the context itself

before: boolean, defaults to False

If True, the callback will be executed before all the reloading processes. Use it if you want to clear your cache for example.

バージョン 1.4.0 で変更: before parameter added.

remove_reload_observer()

(internal) Remove a callback from the observer list previously added by add_reload_observer().