gamnit :: RoundButton :: defaultinit
gamnit :: RoundButton :: name
Event name, should usually correspond to a keyboard key like "a" or "left"gamnit :: RoundButton :: name=
Event name, should usually correspond to a keyboard key like "a" or "left"gamnit :: RoundButton :: texture
Texture drawn for this button, may be fromapp.gamepad_spritesheet
gamnit :: RoundButton :: texture=
Texture drawn for this button, may be fromapp.gamepad_spritesheet
gamnit $ RoundButton :: SELF
Type of this instance, automatically specialized in every classgamnit $ RoundButton :: radius
Radius in UI units/pixels of the part of this controlcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
gamnit :: RoundButton :: defaultinit
gamnit :: RoundControl :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
gamnit :: RoundButton :: name
Event name, should usually correspond to a keyboard key like "a" or "left"gamnit :: RoundButton :: name=
Event name, should usually correspond to a keyboard key like "a" or "left"core :: Object :: output_class_name
Display class name on stdout (debug only).gamnit :: RoundControl :: radius
Radius in UI units/pixels of the part of this controlgamnit :: RoundButton :: texture
Texture drawn for this button, may be fromapp.gamepad_spritesheet
gamnit :: RoundButton :: texture=
Texture drawn for this button, may be fromapp.gamepad_spritesheet
# Simple action button
class RoundButton
super RoundControl
# Event name, should usually correspond to a keyboard key like "a" or "left"
var name: String
# Texture drawn for this button, may be from `app.gamepad_spritesheet`
var texture: Texture
redef fun radius do return 0.5*texture.height
redef fun hit(event, ui_pos)
do
if not event.is_move then
var e = new VirtualGamepadEvent(name.to_s)
e.is_down = event.pressed
app.accept_event e
if event.pressed then
down_names.add name
else down_names.clear
end
return true
end
redef var sprites = [new Sprite(texture, center)] is lazy
end
lib/gamnit/virtual_gamepad/virtual_gamepad.nit:285,1--312,3