本文整理汇总了Python中Menu.text方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.text方法的具体用法?Python Menu.text怎么用?Python Menu.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu.text方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: common_net_options
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import text [as 别名]
def common_net_options(menu_is_enabled, leave_menu):
return [
Menu.Splitter(),
Menu.EventOption(enabled_func = Menu.always,
action = game.save_net_config,
text = Menu.text('Save network options'),
keys = [],
description = 'Save options to net_config.py'),
Menu.Splitter(),
Menu.EventOption(enabled_func = menu_is_enabled,
action = leave_menu,
text = Menu.text('Leave Menu'),
keys = [config.CANCEL_KEY, config.MENU_KEY],
steal_key = True),
]
示例2: netconfig_bool_option
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import text [as 别名]
def netconfig_bool_option(pretty_name, net_config_name,
description):
return Menu.BooleanOption(enabled_func = Menu.always,
option_name = Menu.text(pretty_name),
accessor = game._net_config_accessor(net_config_name),
keys = [],
description = description,
**net_config_kw)
示例3: create_menus
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import text [as 别名]
def create_menus(game):
menus = ADict()
net_config_kw = dict(text_size=NETCONFIG_TEXT_SIZE, keys_text_size=NETCONFIG_KEYS_TEXT_SIZE)
def netconfig_number_option(pretty_name, net_config_name, (min, max, jump),
with_small_font=True,
enabled_func=Menu.always,
**kw):
if with_small_font:
kw.update(net_config_kw)
return Menu.NumberOption(
enabled_func = enabled_func,
option_name = Menu.text(pretty_name),
accessor = game._net_config_accessor(net_config_name),
min = min, max = max, jump = jump,
**kw)
示例4: netconfig_number_option
# 需要导入模块: import Menu [as 别名]
# 或者: from Menu import text [as 别名]
netconfig_number_option('Worm size', 'DIAMETER',
(1, 1000, 1),
description='The size of the worm'),
netconfig_bool_option('Fog enabled', 'FOG_ENABLED',
description='Fog is enabled'),
netconfig_number_option('Fog vision diameter', 'FOG_VISION_DIAMETER',
(0, 1000, 10),
enabled_func=lambda : game.net_config.FOG_ENABLED,
description='The diameter of the vision in fog'),
] + common_net_options(lambda : menus.obscure_net_options.is_enabled(),
lambda : menus.net_options.enable())
menus.obscure_net_options = Menu.Menu(game, options)
options = [
Menu.BooleanOption(enabled_func = game.is_network_game,
option_name = Menu.text('Only pauser can unpause'),
accessor = game._net_config_accessor('ONLY_PAUSER_CAN_UNPAUSE'),
keys = []),
Menu.BooleanOption(enabled_func = Menu.always,
option_name = Menu.text('Synchronized holes'),
accessor = game._net_config_accessor('WORM_SYNC_HOLES'),
keys = []),
Menu.NumberOption(enabled_func = Menu.always,
option_name = Menu.text('Latency'),
accessor = (game.get_latency,
BoundFunc(game.network.run_action_on_all, 'set_latency')),
min = 0, max = 100, jump = 1,
description = 'The amount of time it takes the game to respond'),
netconfig_number_option('Net Interval', 'NET_INTERVAL',
(1, 100, 1),
description='The amount of time between sampling activity',