public Curve(Point s, Point e, double elementSize) : base(s, e) { this.divisionMethod = DivisionMethod.ElementSize; this.elementCount = -1; this.elementSize = elementSize; }
public Curve(Point s, Point e, int elementCount) : base(s, e) { this.divisionMethod = DivisionMethod.ElementCount; this.elementCount = elementCount; this.elementSize = -1.0; }
public Texture2DComponent(string textureName , float xPos = 0, float yPos = 0 , float xSize = 1, float ySize = 1 , DivisionMethod division = DivisionMethod.Fractional , bool register = true) : base(register) { Texture = Core.Renderer.SceneTextures[textureName]; SourceRectanglePosition = new Vector2(xPos, yPos).ApplyDivisionMethod(division, TextureSize); SourceRectangleSize = new Vector2(xSize, ySize).ApplyDivisionMethod(division, TextureSize); }
public static Vector2 ApplyDivisionMethod(this Vector2 raw, DivisionMethod division, Vector2 apply) { switch (division) { case DivisionMethod.Fractional: return(apply * raw); case DivisionMethod.ByPixel: return(raw); default: return(raw); } }
public static float ApplyDivisionMethod(this float raw, DivisionMethod division, float apply) { switch (division) { case DivisionMethod.Fractional: return(apply * raw); case DivisionMethod.ByPixel: return(raw); default: return(raw); } }