• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# LWF.ColorTransform类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LWF.ColorTransform的典型用法代码示例。如果您正苦于以下问题:C# ColorTransform类的具体用法?C# ColorTransform怎么用?C# ColorTransform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ColorTransform类属于LWF命名空间,在下文中一共展示了ColorTransform类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Object

 public Object(LWF lwf, Movie parent, Type type, int objId)
 {
     m_lwf = lwf;
     m_parent = parent;
     m_type = type;
     m_objectId = objId;
     m_matrix = new Matrix();
     m_colorTransform = new ColorTransform();
     m_execCount = 0;
 }
开发者ID:99corps,项目名称:lwf,代码行数:10,代码来源:lwf_object.cs


示例2: CalcColor

 public static void CalcColor(Color dst, Color c, ColorTransform t)
 {
     #if LWF_USE_ADDITIONALCOLOR
     dst.red   = c.red   * t.multi.red   + t.add.red;
     dst.green = c.green * t.multi.green + t.add.green;
     dst.blue  = c.blue  * t.multi.blue  + t.add.blue;
     dst.alpha = c.alpha * t.multi.alpha + t.add.alpha;
     #else
     dst.red   = c.red   * t.multi.red;
     dst.green = c.green * t.multi.green;
     dst.blue  = c.blue  * t.multi.blue;
     dst.alpha = c.alpha * t.multi.alpha;
     #endif
 }
开发者ID:99corps,项目名称:lwf,代码行数:14,代码来源:lwf_utility.cs


示例3: CalcColorTransform

        public static void CalcColorTransform(ColorTransform dst,
		ColorTransform src0, ColorTransform src1)
        {
            dst.multi.red   = src0.multi.red   * src1.multi.red;
            dst.multi.green = src0.multi.green * src1.multi.green;
            dst.multi.blue  = src0.multi.blue  * src1.multi.blue;
            dst.multi.alpha = src0.multi.alpha * src1.multi.alpha;
            #if LWF_USE_ADDITIONALCOLOR
            dst.add.red   = src0.add.red   * src1.multi.red   + src1.add.red;
            dst.add.green = src0.add.green * src1.multi.green + src1.add.green;
            dst.add.blue  = src0.add.blue  * src1.multi.blue  + src1.add.blue;
            dst.add.alpha = src0.add.alpha * src1.multi.alpha + src1.add.alpha;
            #endif
        }
开发者ID:99corps,项目名称:lwf,代码行数:14,代码来源:lwf_utility.cs


示例4: Object

	public Object(LWF lwf, Movie parent, Type type, int objId)
	{
		m_lwf = lwf;
		m_parent = parent;
		m_type = type;
		m_objectId = objId;
		m_matrixId = -1;
		m_colorTransformId = -1;
		m_matrixIdChanged = true;
		m_colorTransformIdChanged = true;
		m_matrix = new Matrix(0, 0, 0, 0, 0, 0);
		m_colorTransform = new ColorTransform(0, 0, 0, 0);
		m_execCount = 0;
		m_updated = false;
	}
开发者ID:BenoitLafont,项目名称:lwf-demo,代码行数:15,代码来源:lwf_object.cs


示例5: CalcColorTransform

        public static ColorTransform CalcColorTransform(LWF lwf,
		ColorTransform dst, ColorTransform src0, int src1Id)
        {
            if (src1Id == 0) {
            dst.Set(src0);
            } else if ((src1Id & (int)Constant.COLORTRANSFORM_FLAG) == 0) {
            AlphaTransform alphaTransform =
                lwf.data.alphaTransforms[src1Id];
            dst.multi.red   = src0.multi.red;
            dst.multi.green = src0.multi.green;
            dst.multi.blue  = src0.multi.blue;
            dst.multi.alpha = src0.multi.alpha * alphaTransform.alpha;
            #if LWF_USE_ADDITIONALCOLOR
            dst.add.Set(src0.add);
            #endif
            } else {
            int colorTransformId = src1Id & ~(int)Constant.COLORTRANSFORM_FLAG;
            ColorTransform src1 = lwf.data.colorTransforms[colorTransformId];
            CalcColorTransform(dst, src0, src1);
            }
            return dst;
        }
开发者ID:BenoitLafont,项目名称:lwf-demo,代码行数:22,代码来源:lwf_utility.cs


示例6: Update

	public override void Update(Matrix m, ColorTransform c)
	{
		int n = m_displayList.Length;
		for (int i = 0; i < n; ++i)
			m_displayList[i].Update(m, c);
	}
开发者ID:pravusjif,项目名称:PravusUnityTests,代码行数:6,代码来源:lwf_graphic.cs


示例7: Update

        public override void Update(Matrix m, ColorTransform c)
        {
            if (!m_active)
            return;

            if (this.totalFrames == 0) {
                m_active = true;
            }

            bool matrixChanged;
            bool colorTransformChanged;

            if (m_overriding) {
            matrixChanged = true;
            colorTransformChanged = true;
            } else {
            matrixChanged = m_matrix.SetWithComparing(m);
            colorTransformChanged = m_colorTransform.SetWithComparing(c);
            }

            if (m_property.hasMatrix) {
            matrixChanged = true;
            m = Utility.CalcMatrix(m_matrix0, m_matrix, m_property.matrix);
            } else {
            m = m_matrix;
            }

            if (m_property.hasColorTransform) {
            colorTransformChanged = true;
            c = Utility.CalcColorTransform(
                m_colorTransform0, m_colorTransform, m_property.colorTransform);
            } else {
            c = m_colorTransform;
            }

            if (m_attachedLWFs != null) {
            m_needsUpdateAttachedLWFs = false;
            m_needsUpdateAttachedLWFs |=
                m_matrixForAttachedLWFs.SetWithComparing(m);
            m_needsUpdateAttachedLWFs |=
                m_colorTransformForAttachedLWFs.SetWithComparing(c);
            }

            for (int dlDepth = 0; dlDepth < m_data.depths; ++dlDepth) {
            Object obj = m_displayList[dlDepth];
            if (obj != null)
                UpdateObject(obj, m, c, matrixChanged, colorTransformChanged);
            }

            if (m_bitmapClips != null) {
            foreach (BitmapClip bitmapClip in m_bitmapClips.Values)
                if (bitmapClip != null)
                    bitmapClip.Update(m, c);
            }

            if (m_attachedMovies != null) {
            foreach (Movie movie in m_attachedMovieList.Values)
                if (movie != null)
                    UpdateObject(movie,
                        m, c, matrixChanged, colorTransformChanged);
            }
        }
开发者ID:dipyalov,项目名称:lwf,代码行数:62,代码来源:lwf_movie.cs


示例8: Update

 public virtual void Update(Matrix m, ColorTransform c)
 {
     Utility.CalcMatrix(m_lwf, m_matrix, m, m_dataMatrixId);
     Utility.CopyColorTransform(m_colorTransform, c);
     m_lwf.RenderObject();
 }
开发者ID:99corps,项目名称:lwf,代码行数:6,代码来源:lwf_object.cs


示例9: CopyColorTransform

        public static ColorTransform CopyColorTransform(
		ColorTransform dst, ColorTransform src)
        {
            if (src == null)
            dst.Clear();
            else
            dst.Set(src);
            return dst;
        }
开发者ID:ken-b4u,项目名称:lwf,代码行数:9,代码来源:lwf_utility.cs


示例10: ForceExec

        public int ForceExec(
		Matrix matrix = null, ColorTransform colorTransform = null)
        {
            return Exec(0, matrix, colorTransform);
        }
开发者ID:yonekawa,项目名称:lwf,代码行数:5,代码来源:lwf_core.cs


示例11: Update

        public void Update(
		Matrix matrix = null, ColorTransform colorTransform = null)
        {
            ++m_updateCount;
            Matrix m = CalcMatrix(matrix);
            ColorTransform c = CalcColorTransform(colorTransform);
            m_renderingIndex = 0;
            m_renderingIndexOffsetted = 0;
            m_rootMovie.Update(m, c);
            m_renderingCount = m_renderingIndex;
            m_propertyDirty = false;
        }
开发者ID:yonekawa,项目名称:lwf,代码行数:12,代码来源:lwf_core.cs


示例12: Update

	public virtual void Update(Matrix m, ColorTransform c)
	{
		m_updated = true;
		if (m != null) {
			Utility.CalcMatrix(m_lwf, m_matrix, m, m_dataMatrixId);
			m_matrixIdChanged = false;
		}
		if (c != null) {
			Utility.CopyColorTransform(m_colorTransform, c);
			m_colorTransformIdChanged = false;
		}
		m_lwf.RenderObject();
	}
开发者ID:BenoitLafont,项目名称:lwf-demo,代码行数:13,代码来源:lwf_object.cs


示例13: LWF

        public LWF(Data lwfData, IRendererFactory r)
        {
            m_data = lwfData;

            interactive = m_data.buttonConditions.Length > 0;
            m_frameRate = m_data.header.frameRate;
            m_execLimit = 3;
            m_tick = 1.0f / m_frameRate;
            m_roundOffTick = m_tick * ROUND_OFF_TICK_RATE;
            m_attachVisible = true;
            m_interceptByNotAllowOrDenyButtons = true;
            m_intercepted = false;
            scaleByStage = 1.0f;
            m_pointX = Single.MinValue;
            m_pointY = Single.MinValue;
            m_pressing = false;
            m_instanceId = ++m_instanceOffset;
            m_alive = true;

            if (!interactive && m_data.frames.Length == 1)
            DisableExec();

            m_property = new Property(this);
            m_instances = new IObject[m_data.instanceNames.Length];
            InitEvent();
            m_movieCommands = new MovieCommands();
            m_programObjectConstructors =
            new ProgramObjectConstructor[m_data.programObjects.Length];
            m_textDictionary = new TextDictionary();

            m_matrix = new Matrix();
            m_matrixIdentity = new Matrix();
            m_colorTransform = new ColorTransform();
            m_colorTransformIdentity = new ColorTransform();

            Init();

            SetRendererFactory(r);
        }
开发者ID:yonekawa,项目名称:lwf,代码行数:39,代码来源:lwf_core.cs


示例14: Update

        public override void Update(Matrix m, ColorTransform c)
        {
            base.Update(m, c);

            if (m_handler != null && m_handler.update != null)
            m_handler.update(this);
        }
开发者ID:99corps,项目名称:lwf,代码行数:7,代码来源:lwf_button.cs


示例15: Update

	public override void Update(Matrix m, ColorTransform c)
	{
		base.Update(m, c);
		if (m_renderer != null)
			m_renderer.Update(m_matrix, m_colorTransform);
	}
开发者ID:DelSystem32,项目名称:lwf,代码行数:6,代码来源:lwf_programobj.cs


示例16: Exec

	public int Exec(float tick = 0,
		Matrix matrix = null, ColorTransform colorTransform = null)
	{
		bool needsToUpdate = false;
		if (matrix != null)
			needsToUpdate |= m_execMatrix.SetWithComparing(matrix);
		if (colorTransform != null)
			needsToUpdate |=
				m_execColorTransform.SetWithComparing(colorTransform);
		DateTime startTime = default(DateTime);
		if (m_parent == null) {
			m_fastForwardCurrent = m_fastForward;
			if (m_fastForwardCurrent) {
				tick = m_tick;
				startTime = DateTime.Now;
			}
		}

		int renderingCount = 0;
		for (;;) {
			renderingCount = ExecInternal(tick);
			needsToUpdate |= m_needsUpdate;
			if (needsToUpdate)
				Update(matrix, colorTransform);
			if (isLWFAttached)
				m_rootMovie.UpdateAttachedLWF();
			if (needsToUpdate)
				m_rootMovie.PostUpdate();
			if (m_fastForwardCurrent && m_fastForward && m_parent == null) {
				var diff = DateTime.Now - startTime;
				if (diff.TotalMilliseconds >= m_fastForwardTimeout)
					break;
			} else {
				break;
			}
		}

		return renderingCount;
	}
开发者ID:rayyee,项目名称:lwf,代码行数:39,代码来源:lwf_core.cs


示例17: Update

        public override void Update(Matrix m, ColorTransform c)
        {
            if (!m_active)
            return;

            bool matrixChanged;
            bool colorTransformChanged;

            if (m_overriding) {
            matrixChanged = true;
            colorTransformChanged = true;
            } else {
            matrixChanged = m_matrix.SetWithComparing(m);
            colorTransformChanged = m_colorTransform.SetWithComparing(c);
            }

            if (m_handler != null)
            m_handler.Call(EventType.UPDATE, this);

            if (m_property.hasMatrix) {
            matrixChanged = true;
            m = Utility.CalcMatrix(m_matrix0, m_matrix, m_property.matrix);
            } else {
            m = m_matrix;
            }

            if (m_property.hasColorTransform) {
            colorTransformChanged = true;
            c = Utility.CalcColorTransform(
                m_colorTransform0, m_colorTransform, m_property.colorTransform);
            } else {
            c = m_colorTransform;
            }

            for (int dlDepth = 0; dlDepth < m_data.depths; ++dlDepth) {
            Object obj = m_displayList[dlDepth];
            if (obj != null)
                UpdateObject(obj, m, c, matrixChanged, colorTransformChanged);
            }

            if (m_attachedMovies != null || m_attachedLWFs != null) {
            if (m_attachedMovies != null) {
                foreach (Movie movie in m_attachedMovieList.Values)
                    if (movie != null)
                        UpdateObject(movie,
                            m, c, matrixChanged, colorTransformChanged);
            }

            if (m_attachedLWFs != null) {
                foreach (KeyValuePair<string, bool> kvp in m_detachedLWFs) {
                    string attachName = kvp.Key;
                    LWFContainer lwfContainer;
                    if (m_attachedLWFs.TryGetValue(
                            attachName, out lwfContainer))
                        DeleteAttachedLWF(this, lwfContainer, true, false);
                }
                m_detachedLWFs.Clear();
                foreach (LWFContainer lwfContainer
                        in m_attachedLWFList.Values) {
                    m_lwf.RenderObject(
                        lwfContainer.child.Exec(m_lwf.thisTick, m, c));
                }
            }
            }
        }
开发者ID:ryokio,项目名称:lwf,代码行数:65,代码来源:lwf_movie.cs


示例18: Movie

        public Movie(LWF lwf, Movie parent, int objId,
			int instId, int matrixId = 0, int colorTransformId = 0,
			bool attached = false, MovieEventHandlers handler = null)
            : base(lwf, parent,
			attached ? Type.ATTACHEDMOVIE : Type.MOVIE, objId, instId)
        {
            m_data = lwf.data.movies[objId];
            m_matrixId = matrixId;
            m_colorTransformId = colorTransformId;
            m_totalFrames = m_data.frames;
            m_instanceHead = null;
            m_instanceTail = null;
            m_currentFrameInternal = -1;
            m_execedFrame = -1;
            m_animationPlayedFrame = -1;
            m_lastControlOffset = -1;
            m_lastControls = -1;
            m_lastHasButton = false;
            m_lastControlAnimationOffset = -1;
            m_skipped = false;
            m_postLoaded = false;
            m_active = true;
            m_visible = true;
            m_playing = true;
            m_jumped = false;
            m_overriding = false;
            m_attachMovieExeced = false;
            m_attachMoviePostExeced = false;
            m_movieExecCount = -1;
            m_postExecCount = -1;

            m_property = new Property(lwf);

            m_matrix0 = new Matrix();
            m_matrix1 = new Matrix();
            m_colorTransform0 = new ColorTransform();
            m_colorTransform1 = new ColorTransform();

            m_displayList = new Object[m_data.depths];

            PlayAnimation(ClipEvent.LOAD);

            m_eventHandlers = new EventHandlerDictionary();
            m_handler.Add(lwf.GetMovieEventHandlers(this));
            m_handler.Add(handler);
            if (m_handler != null)
            m_handler.Call(EventType.LOAD, this);

            lwf.ExecMovieCommand();
        }
开发者ID:ryokio,项目名称:lwf,代码行数:50,代码来源:lwf_movie.cs


示例19: Movie

        public Movie(LWF lwf, Movie parent, int objId, int instId, int matrixId = 0,
			int colorTransformId = 0, bool attached = false,
			MovieEventHandlers handler = null, string n = null)
            : base(lwf, parent,
			attached ? Type.ATTACHEDMOVIE : Type.MOVIE, objId, instId)
        {
            m_data = lwf.data.movies[objId];
            m_matrixId = matrixId;
            m_colorTransformId = colorTransformId;
            m_totalFrames = m_data.frames;

            if (!String.IsNullOrEmpty(n))
            m_name = n;
            m_instanceHead = null;
            m_instanceTail = null;
            m_currentFrameInternal = -1;
            m_execedFrame = -1;
            m_animationPlayedFrame = -1;
            m_lastControlOffset = -1;
            m_lastControls = -1;
            m_lastHasButton = false;
            m_lastControlAnimationOffset = -1;
            m_skipped = false;
            m_postLoaded = false;
            m_active = true;
            m_visible = true;
            m_playing = true;
            m_jumped = false;
            m_overriding = false;
            m_attachMovieExeced = false;
            m_attachMoviePostExeced = false;
            m_movieExecCount = -1;
            m_postExecCount = -1;
            m_blendMode = (int)Constant.BLEND_MODE_NORMAL;
            m_requestedCalculateBounds = false;
            m_calculateBoundsCallback = null;

            m_property = new Property(lwf);

            m_matrix0 = new Matrix();
            m_matrix1 = new Matrix();
            m_matrixForAttachedLWFs = new Matrix();
            m_colorTransform0 = new ColorTransform();
            m_colorTransform1 = new ColorTransform();
            m_colorTransformForAttachedLWFs = new ColorTransform();

            m_displayList = new Object[m_data.depths];

            m_eventHandlers = new EventHandlers();
            m_handler = new MovieEventHandlers();
            m_handler.Add(lwf.GetMovieEventHandlers(this));
            m_handler.Add(handler);

            #if LWF_USE_LUA
            m_isRoot = objId == lwf.data.header.rootMovieId;
            if (m_isRoot) {
            if (parent == null)
                lwf.CallFunctionLua("Init", this);
            lwf.GetFunctionsLua(objId, out m_rootLoadFunc,
                out m_rootPostLoadFunc, out m_rootUnloadFunc,
                    out m_rootEnterFrameFunc, true);
            }
            lwf.GetFunctionsLua(objId, out m_loadFunc, out m_postLoadFunc,
            out m_unloadFunc, out m_enterFrameFunc, false);

            if (m_isRoot && !String.IsNullOrEmpty(m_rootLoadFunc))
            lwf.CallFunctionLua(m_rootLoadFunc, this);
            if (m_loadFunc != String.Empty)
            lwf.CallFunctionLua(m_loadFunc, this);
            #endif

            PlayAnimation(ClipEvent.LOAD);
            if (!m_handler.Empty())
            m_handler.Call(EventType.LOAD, this);

            lwf.ExecMovieCommand();
        }
开发者ID:dipyalov,项目名称:lwf,代码行数:77,代码来源:lwf_movie.cs


示例20: Update

        public override void Update(Matrix m, ColorTransform c)
        {
            base.Update(m, c);

            if (m_handler != null)
            m_handler.Call(EventType.UPDATE, this);
        }
开发者ID:neojjang,项目名称:lwf,代码行数:7,代码来源:lwf_button.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LWF.Movie类代码示例发布时间:2022-05-26
下一篇:
C# LSharp.Cons类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap