我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用kivy.properties.NumericProperty()。
def add_point_vals(self, x_val, y_val): # Calculate position of point according to coordinate value x_pos = round(x_val * self.x_increment) y_pos = self.graph_height - round(y_val * self.y_increment) # Create new point new_point = Point(x_pos, y_pos, x_val, y_val) # new_point.x_pos = NumericProperty(x_pos) # new_point.y_pos = NumericProperty(y_pos) # new_point.x_value = x_val # new_point.y_value = y_val # Add point self.add_point(new_point)