本文整理汇总了Python中panda3d.core.WindowProperties.get_size方法的典型用法代码示例。如果您正苦于以下问题:Python WindowProperties.get_size方法的具体用法?Python WindowProperties.get_size怎么用?Python WindowProperties.get_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.WindowProperties
的用法示例。
在下文中一共展示了WindowProperties.get_size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_winprops_copy_ctor
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import get_size [as 别名]
def test_winprops_copy_ctor():
props = WindowProperties()
props.set_size(1, 2)
props2 = WindowProperties(props)
assert props == props2
assert props2.get_size() == (1, 2)
with pytest.raises(TypeError):
WindowProperties(None)
示例2: test_winprops_ctor_kwargs
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import get_size [as 别名]
def test_winprops_ctor_kwargs():
props = WindowProperties(size=(1, 2), origin=3)
assert props.has_size()
assert props.get_size() == (1, 2)
assert props.has_origin()
assert props.get_origin() == (3, 3)
# Invalid property should throw
with pytest.raises(TypeError):
WindowProperties(swallow_type="african")
# Invalid value should throw
with pytest.raises(TypeError):
WindowProperties(size="invalid")
示例3: test_winprops_size_property
# 需要导入模块: from panda3d.core import WindowProperties [as 别名]
# 或者: from panda3d.core.WindowProperties import get_size [as 别名]
def test_winprops_size_property():
props = WindowProperties()
# Test get
props.set_size(1, 2)
assert props.size == (1, 2)
# Test has
props.clear_size()
assert props.size is None
# Test set
props.size = (4, 5)
assert props.get_size() == (4, 5)
# Test clear
props.size = None
assert not props.has_size()