コード例 #1
0
    def apply_force(self, force, point):
        fp_core_force = libfp_core.Point()
        fp_core_force.x = force.x
        fp_core_force.y = force.y

        fp_core_point = libfp_core.Point()
        fp_core_point.x = point.x
        fp_core_point.y = point.y

        return self.run_native("apply_force", fp_core_force, fp_core_point)
コード例 #2
0
ファイル: group.py プロジェクト: steventuckness/fruitpunch
    def set_scale(self, value):
        '''
        convert to native fp_core Point object
        set scale 
        '''

        if hasattr(value, "x"):
            p = libfp_core.Point()
            p.x = value.x
            p.y = value.y
        elif isinstance(value, float):
            p = libfp_core.Point()
            p.x = value
            p.y = value
        else:
            raise Exception(
                "Native group set_scale must take a Point or float")

        return self.run_native("set_scale", p)
コード例 #3
0
ファイル: group.py プロジェクト: steventuckness/fruitpunch
    def set_position(self, point):
        '''
        convert to native  fp_core Point object
        sets position of the group and updates all of the items in the 
        group as well
        '''
        p = libfp_core.Point()
        p.x = point.x
        p.y = point.y

        return self.run_native("set_position", p)
コード例 #4
0
    def set_gravity(self, gravity):
        p = libfp_core.Point()
        p.x = gravity.x
        p.y = gravity.y

        return self.run_native("set_gravity", p)
コード例 #5
0
    def set_linear_velocity(self, velocity):
        p = libfp_core.Point()
        p.x = velocity.x
        p.y = velocity.y

        return self.run_native("set_linear_velocity", p)