⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gametable.as.svn-base

📁 Flex3实现的掼蛋游戏
💻 SVN-BASE
字号:
/**
 * Project: 用户可视对象类
 * 可视对象 每个类有位置(string),头像(image),姓名(String),积分(uint),手中牌(Array)
 * 可以设定头像以及扑克牌 说明信息的位置,分上,下,左,右,四种情况
 * Author : dmh2002 http://www.08baby.com/
 * Date : 2008.4.8
 */
package com.dmh2002.games.cardgame.cairngorm.view
{
	import com.dmh2002.games.cardgame.cairngorm.model.CardGameModelLoactor;
	
	import flash.events.MouseEvent;
	
	import mx.containers.Canvas;
	import mx.controls.Alert;
	import mx.controls.Image;
	import mx.controls.Label;

	public class GameTable extends Canvas
	{	
		[Bindable]
		private var  _model:CardGameModelLoactor = CardGameModelLoactor.getInstance();

		public var _TableImage:Image = new Image()
		public var _TableLabel:Label = new Label()
		
	
		public var _BottomImage:Image = new Image()
		public var _BottomLabel:Label = new Label()
		
		
	
		public var _RightImage:Image = new Image()
		public var _RightLabel:Label = new Label()
		
		
	
		public var _TopImage:Image = new Image()
		public var _TopLabel:Label = new Label()
		
		
	
		public var _LeftImage:Image = new Image()
		public var _LeftLabel:Label = new Label()
		
		
		public var _TablesID:uint = 0;
		public var  alert:Alert
		
		
		/** get/set 存储器 **/
		
		
		/** 
		 * 构造函数
		 * 参数 userName    String   用户名
		 * 参数 isComputer  Boolean  是否为计算机  默认 true
		 * 参数 userSex     String   用户性别      默认 null
		 * 参数 userFace    Class    用户头像      默认 null
		 * 
		 * 
		 */
		 
		/** 点击时桌面 */
		
		 
		public function GameTable(TableID:uint)
		{
			super();
			// 桌面图片处理品
			this._TablesID = TableID;
			
			this.addTable(this._TablesID)
		}
		
		private function addTable(Num:uint):void
		{
			this.setStyle("fontSize",12);
			//this.setStyle("fontWeight","bold");
			this.setStyle("color","#000000");
			//
			
			
			_TableImage.source = _model.myTable;
			_TableImage.width = _model.Table_Width;
			_TableImage.height = _model.Table_Height;
			_TableImage.x = _model.Seat_Height + _model.Seat_Space;
			_TableImage.y = _model.Seat_Height + _model.Seat_Space;
			_TableImage.name = Num + "_table";

			
			_TableLabel.text = Num + "桌";
			_TableLabel.x = _model.Seat_Height + _model.Seat_Space ;
			_TableLabel.y = _model.Seat_Height + _model.Seat_Space ;
			_TableLabel.width = _model.Table_Width;
			_TableLabel.height = _model.Table_Height;
			
			
			this.addChild(_TableImage);
			this.addChild(_TableLabel);
			
			

			_BottomImage.source = _model.myBottom;
			_BottomImage.percentWidth = _model.Seat_Width;
			_BottomImage.percentHeight = _model.Seat_Height;
			_BottomImage.width = _model.Seat_Width;
			_BottomImage.height = _model.Seat_Height;
			_BottomImage.x = _model.Seat_Height + (_model.Table_Width - _model.Seat_Width) / 2 + _model.Seat_Space;
			_BottomImage.y = _model.Seat_Height + _model.Table_Height + _model.Seat_Space * 2;
			_BottomImage.name = Num + "_Bottom";
			
			_BottomLabel.text = _model.SeatWecome;
			_BottomLabel.x = _BottomImage.x + _BottomImage.width;
			_BottomLabel.y = _BottomImage.y + _BottomImage.height / 2;

			this.addChild(_BottomImage);
			this.addChild(_BottomLabel);
		
			
			_RightImage.source = _model.myRight;
			_RightImage.width = _model.Seat_Height;
			_RightImage.height = _model.Seat_Width;
			_RightImage.x = _model.Seat_Height +   _model.Table_Width + _model.Seat_Space * 2;
			_RightImage.y = _model.Seat_Height + (_model.Table_Height - _model.Seat_Width) / 2 + _model.Seat_Space;
			_RightImage.name = Num + "_Right";
			
			_RightLabel.text = _model.SeatWecome;
			_RightLabel.x = _RightImage.x;
			_RightLabel.y = _RightImage.y  + _RightImage.height;
			
			this.addChild(_RightImage);
			this.addChild(_RightLabel);
		
		
			
			_TopImage.source = _model.myTop;
			_TopImage.width = _model.Seat_Width;
			_TopImage.height = _model.Seat_Height;
			_TopImage.x = _model.Seat_Height + (_model.Table_Width - _model.Seat_Width) / 2 + _model.Seat_Space;
			_TopImage.y = 0;
			_TopImage.name = Num + "_Top";
			
			_TopLabel.text = _model.SeatWecome;
			_TopLabel.x = _TopImage.x + _TopImage.width;
			_TopLabel.y = _TopImage.y + _TopImage.height / 2;
			
			this.addChild(_TopImage);
			this.addChild(_TopLabel);
		
		
			
			_LeftImage.source = _model.myLeft;
			_LeftImage.width = _model.Seat_Height;
			_LeftImage.height = _model.Seat_Width;
			_LeftImage.x = 0;
			_LeftImage.y = _model.Seat_Height + (_model.Table_Height - _model.Seat_Width) / 2 + _model.Seat_Space;
			_LeftImage.name = Num + "_Left";
			
			_LeftLabel.text = _model.SeatWecome;
			_LeftLabel.x = _LeftImage.x;
			_LeftLabel.y = _LeftImage.y + _LeftImage.height;
			
			this.addChild(_LeftImage); 
			this.addChild(_LeftLabel); 
			
		
		}
		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -