Commit f16a3fd2 authored by wildfirecode's avatar wildfirecode

1

parent 54697ff1
......@@ -90,7 +90,7 @@
},
{
"name": "preload",
"keys": "namebg_png,avatar_png,invite_txtbg_png,invite_icon_png,taskicon_png,friend_avatar_png,ad_icon_png,testavatar_png"
"keys": "namebg_png,avatar_png,invite_txtbg_png,invite_icon_png,taskicon_png,friend_avatar_png,ad_icon_png,testavatar_png,friend按钮-炫耀_png,friend_icon1_png,friend_icon2_png,friend_icon3_png,friend_itembg_png,friendbg_png"
}
],
"resources": [
......@@ -2013,6 +2013,36 @@
"name": "testavatar_png",
"type": "image",
"url": "assets/testavatar.png"
},
{
"name": "friend按钮-炫耀_png",
"type": "image",
"url": "assets/friend/friend按钮-炫耀.png"
},
{
"name": "friend_icon1_png",
"type": "image",
"url": "assets/friend/friend_icon1.png"
},
{
"name": "friend_icon2_png",
"type": "image",
"url": "assets/friend/friend_icon2.png"
},
{
"name": "friend_icon3_png",
"type": "image",
"url": "assets/friend/friend_icon3.png"
},
{
"name": "friend_itembg_png",
"type": "image",
"url": "assets/friend/friend_itembg.png"
},
{
"name": "friendbg_png",
"type": "image",
"url": "assets/friend/friendbg.png"
}
]
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/AvatarSkin.exml",
"resource/skins/AlertSkin.exml",
"resource/skins/Blood2Skin.exml",
"resource/skins/BloodSkin.exml",
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="AvatarSkin" width="79" height="85" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="friend_avatar_png"/>
<e:Group x="8.5" y="8.8">
<e:Image id="avatar" y="0" source="testavatar_png" width="64" height="64" x="0"/>
<e:Rect id="avatarMask" width="64" height="64" y="0" ellipseWidth="64" ellipseHeight="64"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="FriendItemSkin" width="400" height="50" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Label id="nameTxt" text="111" x="20" y="16"/>
<e:Skin class="FriendItemSkin" width="546" height="105" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="friend_itembg_png"/>
<e:Label id="nameTxt" text="111" x="490" y="52.5"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="FriendSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="闯关失败_png" y="27" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="609" y="197">
<e:Image source="friendbg_png" y="31" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="632.94" y="164.98">
<e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
......@@ -9,7 +9,7 @@
</e:Skin>
</e:skinName>
</e:Button>
<e:Scroller id="scroll" width="400" height="400" y="279" horizontalCenter="0" scrollPolicyV="on" scrollPolicyH="off">
<e:Scroller id="scroll" width="546" height="555" y="412.35" scrollPolicyV="on" scrollPolicyH="off" x="122">
<e:Group>
<e:List id="list" width="100%" itemRendererSkinName="FriendItemSkin">
<e:ArrayCollection>
......@@ -27,10 +27,21 @@
</e:Array>
</e:ArrayCollection>
<e:layout>
<e:VerticalLayout gap="0"/>
<e:VerticalLayout gap="6"/>
</e:layout>
</e:List>
</e:Group>
</e:Scroller>
<e:Label text="friendBtn" x="80" y="468"/>
<e:Button id="btn" label="" y="985.99" horizontalCenter="0">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="friend按钮-炫耀_png" source.down="friend按钮-炫耀_png" source.disabled="friend按钮-炫耀_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Group x="323.87" y="104.79">
<e:Image id="avatar" y="0" source="testavatar_png" width="120" height="120" x="0"/>
<e:Rect id="avatarMask" width="120" height="120" y="0" ellipseWidth="120" ellipseHeight="120"/>
</e:Group>
</e:Skin>
\ No newline at end of file
......@@ -150,7 +150,7 @@
</e:Group>
<e:Group id="friendBtn" x="13.56" y="126.88" width="171" height="120">
<e:Image source="avatar_png" y="0" horizontalCenter="0"/>
<e:Group x="38.5" y="10" locked="true">
<e:Group x="38.5" y="10">
<e:Image id="avatar" y="0" source="testavatar_png" width="96" height="96" x="0"/>
<e:Rect id="avatarMask" width="96" height="96" x="0" y="0" ellipseWidth="96" ellipseHeight="96"/>
</e:Group>
......
import ComponentBase from "../../libs/new_wx/components/ComponentBase";
export default class AvatarComp extends ComponentBase {
start(data?) {
this.touchEnabled=this.touchChildren=false;
super.start(data);
this['avatar'].mask = this['avatarMask'];
}
get skinKey(): string { return 'Avatar' }
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import setGray from "../setGray";
import { loadSvga } from "../loadSvga";
import getResPath from "../../libs/new_tc/getResPath";
import CountDown from "./CountDown";
import AvatarComp from "./AvatarComp";
export default class MapScene extends Scene {
......@@ -145,6 +146,7 @@ export default class MapScene extends Scene {
this.updateHomeData();
this.updateAvatars();
this.showLog();
this.updateBox();
......@@ -261,6 +263,23 @@ export default class MapScene extends Scene {
updateScene() {
this.updateHomeData();
}
addAvatar(level,data?){
const item = MapScene.starHash[level];
const parent = item.parent;
const avatar = new AvatarComp();
avatar.loadSkin();
avatar.start(data);
parent.addChild(avatar);
avatar.x=item.x;
avatar.y=item.y - avatar.height;
}
updateAvatars(){
// 4 70
this.addAvatar(4);
this.addAvatar(70);
this.addAvatar(71);
}
updateHomeData() {
const homeData = getHomeData();
......
......@@ -12,7 +12,7 @@ export default class FriendPanel extends Panel {
const ac = new eui.ArrayCollection([1,2,3,4,5,6,7,8,9,10]);
this.list.dataProvider = ac;
this['btn'].addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTapInvite,this);
}
showlog(){
......@@ -27,8 +27,9 @@ export default class FriendPanel extends Panel {
}
onTapInvite() {
console.log('onTapInvite')
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
get skinKey() { return 'Friend' }
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment