Beispiel #1
0
 public static FontHandle CreateFont(
     int height,
     int width,
     int escapement,
     int orientation,
     FontWeight weight,
     bool italic,
     bool underline,
     bool strikeout,
     CharacterSet characterSet,
     OutputPrecision outputPrecision,
     ClippingPrecision clippingPrecision,
     Quality quality,
     FontPitch pitch,
     FontFamily family,
     string typeface) => GdiMethods.CreateFont(
     height, width, escapement, orientation, weight, italic, underline, strikeout, characterSet, outputPrecision, clippingPrecision, quality, pitch, family, typeface);
Beispiel #2
0
 get => new MixtureSettings()
 {
     widthScale      = 1.0f,
     heightScale     = 1.0f,
     depthScale      = 1.0f,
     width           = 1024,
     height          = 1024,
     depth           = 1,
     sizeMode        = OutputSizeMode.InheritFromParent,
     dimension       = OutputDimension.InheritFromParent,
     outputChannels  = OutputChannel.InheritFromParent,
     outputPrecision = OutputPrecision.InheritFromParent,
     editFlags       = ~EditFlags.POTSize,
     doubleBuffered  = false,
     wrapMode        = OutputWrapMode.InheritFromParent,
     filterMode      = OutputFilterMode.InheritFromParent,
     refreshMode     = RefreshMode.OnLoad,
 };
Beispiel #3
0
 public static FontHandle CreateFont(
     int height,
     int width,
     int escapement,
     int orientation,
     FontWeight weight,
     bool italic,
     bool underline,
     bool strikeout,
     CharacterSet characterSet,
     OutputPrecision outputPrecision,
     ClippingPrecision clippingPrecision,
     Quality quality,
     FontPitch pitch,
     FontFamily family,
     string typeface)
 {
     return(Imports.CreateFontW(height, width, escapement, orientation, weight, italic, underline, strikeout, (uint)characterSet,
                                (uint)outputPrecision, (uint)clippingPrecision, (uint)quality, (uint)((byte)pitch | (byte)family), typeface));
 }
Beispiel #4
0
        private static string SpriteGlow_GlowOutside(string textureName, string samplerName, string textureUVName, string glowColorName, string glowBrightnessName, string outlineWidthName, string alphaThresholdName, string outputColorName, OutputPrecision precision)
        {
            return(string.Format(@"
    {8}4 color = SAMPLE_TEXTURE2D({0}, {1}, {2});
    int shouldDrawOutline = 0; 

    float texelWidth;
    float texelHeight;
    {0}.GetDimensions(texelWidth, texelHeight);

    if ({5} * color.a != 0)
    {{
        float2 texDdx = ddx({2});
        float2 texDdy = ddy({2});

        for (int i = 1; i <= 10; i++)
        {{
            float2 pixelUpTexCoord = {2} + float2(0, i * texelHeight);
            float pixelUpAlpha = pixelUpTexCoord.y > 1.0 ? 0.0 : tex2Dgrad({1}, pixelUpTexCoord, texDdx, texDdy).a;
            if (pixelUpAlpha <= {6}) {{ shouldDrawOutline = 1; break; }}

            float2 pixelDownTexCoord = {2} - float2(0, i * texelHeight);
            float pixelDownAlpha = pixelDownTexCoord.y < 0.0 ? 0.0 : tex2Dgrad({1}, pixelDownTexCoord, texDdx, texDdy).a;
            if (pixelDownAlpha <= {6}) {{ shouldDrawOutline = 1; break; }}

            float2 pixelRightTexCoord = {2} + float2(i * texelWidth, 0);
            float pixelRightAlpha = pixelRightTexCoord.x > 1.0 ? 0.0 : tex2Dgrad({1}, pixelRightTexCoord, texDdx, texDdy).a;
            if (pixelRightAlpha <= {6}) {{ shouldDrawOutline = 1; break; }}

            float2 pixelLeftTexCoord = {2} - float2(i * texelWidth, 0);
            float pixelLeftAlpha = pixelLeftTexCoord.x < 0.0 ? 0.0 : tex2Dgrad({1}, pixelLeftTexCoord, texDdx, texDdy).a;
            if (pixelLeftAlpha <= {6}) {{ shouldDrawOutline = 1; break; }}

            if (i > {5}) break;
        }}
    }}

    {8}4 {7} = lerp(color, {3} * {4} * {3}.a, shouldDrawOutline);",
                                 textureName, samplerName, textureUVName, glowColorName, glowBrightnessName, outlineWidthName, alphaThresholdName, outputColorName, precision));
        }
Beispiel #5
0
 public string ConvertToStringWithPrecision(OutputPrecision precision)
 {
     return(memoryValue.ToString(precision.GetPrecision()));
 }