text
stringlengths 0
828
|
---|
4833,"def adjuestSize(self, offsetWidth = 0, offsetHeight = 0): |
""""""! |
\~english |
Adjuest width and height of rectangles |
@param offsetWidth: adjust the width. Negative numbers are smaller, Positive number is increased |
@param offsetHeight: adjust the height. Negative numbers are smaller, Positive number is increased |
@note The negative numbers are smaller, positive number is increased,0 remains unchanged. |
\~chinese |
调整矩形高宽数据 |
@param offsetWidth: 调整宽度。 负数较小,正数增加 |
@param offsetHeight: 调整高度。 负数较小,正数增加 |
@note 负数较小,正数增加,0保持不变。 |
"""""" |
self.height += offsetHeight |
self.width += offsetWidth" |
4834,"def moveTo(self, newX=0, newY=0): |
""""""! |
\~english |
Move vertex of rectangles to new point (x,y) |
@param newX: Coordinated X value |
@param newY: Coordinated Y value |
\~chinese |
移动矩形到新坐标点 (x,y) |
@param newX: 坐标 X |
@param newY: 坐标 Y |
"""""" |
self.x = newX |
self.y = newY" |
4835,"def moveOffset(self, offsetX=0, offsetY=0): |
""""""! |
\~english |
Offset vertex of rectangles to new point (x,y) |
@param offsetX: offset X value |
@param offsetY: offset Y value |
@note The negative numbers are left or up move , positive number is right or down move,0 remains unchanged. |
\~chinese |
平移矩形指定的距离 (x,y) |
@param offsetX: 平移 X |
@param offsetY: 平移 Y |
@note 负数是左移( X )或上移( Y ),正数是右移( X )或下移( Y ),0 保持不变。 |
"""""" |
self.x += offsetX |
self.y += offsetY" |
4836,"def swapWH(self): |
""""""! |
\~english Swap width and height of rectangles |
\~chinese 交换矩形高宽边数据 |
"""""" |
width = self.width |
self.width = self.height |
self.height = width" |
4837,"def rectToArray(self, swapWH = False): |
""""""! |
\~english |
Rectangles converted to array of coordinates |
@return: an array of rect points. eg. (x1,y1,x2,y2) |
\~chinese |
矩形数据转换为矩形坐标数组 |
@return: 矩形座标数组, 例如: ( x1,y1,x2,y2 ) |
"""""" |
if swapWH == False: |
return [self.x, self.y, self.x + self.width, self.y + self.height] |
else: |
return [self.x, self.y, self.x + self.height, self.y + self.width]" |
4838,"def _needSwapWH(self, oldDirection, newDirection ): |
""""""! |
\~english |
return screen direction status |
@return Boolean |
@note No need to rotate if the screen orientation is 0 degrees and 180 degrees |
\~chinese |
返回屏幕方向状态 |
@return 布尔值 |
@note 如果屏幕方向是0度和180度就不需要旋转 |
"""""" |
if abs(newDirection - oldDirection) == 0: return False |
if abs(newDirection - oldDirection) % 180 == 0: return False |
if abs(newDirection - oldDirection) % 90 == 0: return True |
return False" |
4839,"def rotateDirection(self, displayDirection): |
""""""! |
\~english rotate screen direction |
@param displayDirection: Screen Direction. value can be chosen: 0, 90, 180, 270 |
\~chinese 旋转显示屏方向 |
@param displayDirection: 显示屏方向。可选值: 0, 90, 180, 270 |
\~ |
@note |
\~english after rotate the View resize to screen size |
\~chinese 改变方向后,默认的 View 大小会更新为当前 Screen 的大小 |
\~\n |
"""""" |
if self._needSwapWH(self._display_direction, displayDirection): |
self._display_size = ( self._display_size[1], self._display_size[0] ) |
if self.redefineBuffer( { ""size"":self._display_size, ""color_mode"":self._buffer_color_mode } ): |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.