当前位置: 首页>>代码示例>>C#>>正文


C# dfMarkupBox.GetOffset方法代码示例

本文整理汇总了C#中dfMarkupBox.GetOffset方法的典型用法代码示例。如果您正苦于以下问题:C# dfMarkupBox.GetOffset方法的具体用法?C# dfMarkupBox.GetOffset怎么用?C# dfMarkupBox.GetOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dfMarkupBox的用法示例。


在下文中一共展示了dfMarkupBox.GetOffset方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getViewportIntersection

    private dfIntersectionType getViewportIntersection( dfMarkupBox box )
    {
        if( box.Display == dfMarkupDisplayType.none )
            return dfIntersectionType.None;

        var viewSize = this.Size;
        var min = box.GetOffset() - scrollPosition;
        var max = min + box.Size;

        if( max.x <= 0 || max.y <= 0 )
            return dfIntersectionType.None;

        if( min.x >= viewSize.x || min.y >= viewSize.y )
            return dfIntersectionType.None;

        if( min.x < 0 || min.y < 0 || max.x > viewSize.x || max.y > viewSize.y )
            return dfIntersectionType.Intersecting;

        return dfIntersectionType.Inside;
    }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:20,代码来源:dfRichTextLabel.cs

示例2: getViewportIntersection

 private dfIntersectionType getViewportIntersection(dfMarkupBox box)
 {
     if (box.Display == dfMarkupDisplayType.none)
     {
         return dfIntersectionType.None;
     }
     Vector2 size = base.Size;
     Vector2 offset = box.GetOffset() - this.scrollPosition;
     Vector2 vector2 = offset + box.Size;
     if (vector2.x <= 0f || vector2.y <= 0f)
     {
         return dfIntersectionType.None;
     }
     if (offset.x >= size.x || offset.y >= size.y)
     {
         return dfIntersectionType.None;
     }
     if (offset.x >= 0f && offset.y >= 0f && vector2.x <= size.x && vector2.y <= size.y)
     {
         return dfIntersectionType.Inside;
     }
     return dfIntersectionType.Intersecting;
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:23,代码来源:dfRichTextLabel.cs

示例3: gatherRenderBuffers

    private void gatherRenderBuffers( dfMarkupBox box, dfList<dfRenderData> buffers )
    {
        var intersectionType = getViewportIntersection( box );
        if( intersectionType == dfIntersectionType.None )
        {
            return;
        }

        var buffer = box.Render();
        if( buffer != null )
        {

            if( buffer.Material == null )
            {
                if( this.atlas != null )
                {
                    buffer.Material = atlas.Material;
                }
            }

            var p2u = PixelsToUnits();
            var scroll = -scrollPosition.Scale( 1, -1 ).RoundToInt();
            var offset = (Vector3)( scroll + box.GetOffset().Scale( 1, -1 ) ) + pivot.TransformToUpperLeft( Size );

            var vertices = buffer.Vertices;
            for( int i = 0; i < buffer.Vertices.Count; i++ )
            {
                vertices[ i ] = ( offset + vertices[ i ] ) * p2u;
            }

            if( intersectionType == dfIntersectionType.Intersecting )
            {
                clipToViewport( buffer );
            }

            buffer.Transform = transform.localToWorldMatrix;
            buffers.Add( buffer );

        }

        for( int i = 0; i < box.Children.Count; i++ )
        {
            gatherRenderBuffers( box.Children[ i ], buffers );
        }
    }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:45,代码来源:dfRichTextLabel.cs

示例4: gatherRenderBuffers

 private void gatherRenderBuffers(dfMarkupBox box, dfList<dfRenderData> buffers)
 {
     dfIntersectionType viewportIntersection = this.getViewportIntersection(box);
     if (viewportIntersection == dfIntersectionType.None)
     {
         return;
     }
     dfRenderData material = box.Render();
     if (material != null)
     {
         if (material.Material == null && this.atlas != null)
         {
             material.Material = this.atlas.Material;
         }
         float units = base.PixelsToUnits();
         Vector2 num = -this.scrollPosition.Scale(1f, -1f).RoundToInt();
         Vector3 vector3 = (num + box.GetOffset().Scale(1f, -1f)) + this.pivot.TransformToUpperLeft(base.Size);
         dfList<Vector3> vertices = material.Vertices;
         Matrix4x4 matrix4x4 = base.transform.localToWorldMatrix;
         for (int i = 0; i < material.Vertices.Count; i++)
         {
             vertices[i] = matrix4x4.MultiplyPoint((vector3 + vertices[i]) * units);
         }
         if (viewportIntersection == dfIntersectionType.Intersecting)
         {
             this.clipToViewport(material);
         }
         buffers.Add(material);
     }
     for (int j = 0; j < box.Children.Count; j++)
     {
         this.gatherRenderBuffers(box.Children[j], buffers);
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:34,代码来源:dfRichTextLabel.cs


注:本文中的dfMarkupBox.GetOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。