Commit 8d0fbb3e authored by 李维's avatar 李维

dev commit

parent 9f3a2900
@import '../style/common_mixin.css';
.model-content {
width: 100%;
height: 100%;
}
<div class="model-content" style="min-width: 850px;">
<div class="card-config">
<div class="card-item">
<div class="card-item-content">
<div class="title">模板配置</div>
<div *ngIf="dataArray.length>0" class="section" style="padding: 1rem;">
<nz-form-item>
<nz-form-control [nzSpan]="4">
<div class="text-label">格子数量(宽*高)</div>
</nz-form-control>
<nz-form-control [nzSpan]="20">
<div style="width: 100px">
<nz-select [(ngModel)]="size.wh" style="width: 100%;" (ngModelChange)="handleGirdSizeChange()">
<nz-option nzValue="9*9" nzLabel="9 * 9"></nz-option>
<nz-option nzValue="12*12" nzLabel="12 * 12"></nz-option>
<nz-option nzValue="15*15" nzLabel="15 * 15"></nz-option>
<nz-option nzValue="17*17" nzLabel="17 * 17"></nz-option>
</nz-select>
</div>
</nz-form-control>
</nz-form-item>
<div class="model-content">
<nz-form-item>
<nz-form-control [nzSpan]="4">
<div class="text-label">题号选择</div>
</nz-form-control>
<nz-form-control [nzSpan]="20">
<nz-radio-group [(ngModel)]="currentSet" nzButtonStyle="solid" (ngModelChange)="handleCurrentIndexChange()">
<label *ngFor="let item of dataArray; let i = index" nz-radio-button [nzValue]="i">{{i+1}}</label>
</nz-radio-group>
<button nz-button nzShape="circle" style="margin-left: 10px;" (click)="addItem()"><i nz-icon nzType="plus"></i></button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control [nzSpan]="4">
<div class="text-label">文字提示</div>
</nz-form-control>
<nz-form-control [nzSpan]="20">
<div *ngFor="let item of dataArray; let i = index">
<textarea *ngIf="i==currentSet" [(ngModel)]="item.text" nz-input nzAutosize (blur)="saveItem()"></textarea>
</div>
</nz-form-control>
</nz-form-item>
<div style="position: absolute; left: 200px; top: 100px; width: 800px;">
<nz-form-item>
<nz-form-control [nzSpan]="4">
<div class="text-label">填空设置</div>
</nz-form-control>
<nz-form-control [nzSpan]="20">
<div *ngFor="let oneRow of grid; let x = index" class="clearfix">
<div *ngFor="let oneGrid of oneRow; let y = index" style="float: left; padding: 2px;">
<input style="width: 38px" (focus)="selectContent($event)" class="inputBlock" [disabled]="(oneGrid.index != currentSet && oneGrid.index!=-1)" [maxLength]="1" type="text" nz-input [(ngModel)]="oneGrid.text" (blur)="handeGridChange($event, oneGrid, x, y)" >
</div>
</div>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-control [nzSpan]="4">
</nz-form-control>
<nz-form-control [nzSpan]="20">
<button nz-button nzSize="small" nzType="primary" (click)="resetByIndex(currentSet,false)">清除本题已填写字母</button>
<button nz-button nzSize="small" [disabled]="dataArray.length==1" nzType="danger" style="margin-left: 10px;" (click)="deleteByIndex(currentSet)"><i nz-icon nzType="delete"></i>删除本题</button>
</nz-form-control>
</nz-form-item>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
<app-upload-image-with-preview
[picUrl]="item.pic_url"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url')"
></app-upload-image-with-preview>
<app-audio-recorder
[audioUrl]="item.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url')"
></app-audio-recorder>
<app-custom-hot-zone></app-custom-hot-zone>
<app-upload-video></app-upload-video>
<app-lesson-title-config></app-lesson-title-config>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
</div>
\ No newline at end of file
@import "../style/common_mixin";
.model-content {
margin: 10px;
.card-config {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
flex-direction:column;
.card-item{
flex:1;
margin: 1rem;
.card-item-content{
.title {
font-size: 24px;
width: 100%;
text-align: center;
}
.section{
border-top: 1px solid ;
padding: 10px 0;
.section-title{
font-size: 24px;
width: 100%;
}
.section-content{
display: flex;
margin: 5px 0 10px 0;
}
}
.pic-sound-box {
width: 50%;
display: flex;
flex-direction: column;
}
.add-btn-box {
display: flex;
align-items: center;
justify-content: center;
height: 20vw;
padding: 10px;
padding-top: 5vw;
}
}
}
}
}
.border {
border-radius: 20px;
border-style: dashed;
padding:20px;
width: 100%;
}
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.form-item p{
padding-left: 100px;
position: relative;
span {
position: absolute;
left: 0;
font-weight: bold;
}
}
.highLight {
background-color: #ff0;
}
.index-button {
margin: 0 5px;
}
.text-label {
text-align: right;
padding-right: 20px;
position: relative;
}
.text-label::after {
content: ":";
position: absolute;
right: 10px;
}
.ant-input-disabled, .ant-input[disabled] {
background-color: #702ff4;
opacity: 0.5;
cursor: not-allowed;
color: #FFF;
}
.inputBlock{
cursor: pointer;
color: transparent;
text-shadow: 0 0 0 #000;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.game-container {
width: 100%;
height: 100%;
background: #ffffff;
background-size: cover;
}
#canvas {
}
@font-face
{
font-family: 'BRLNSDB';
src: url("../../assets/font/BRLNSDB.TTF") ;
}
.game-container {
width: 100%;
height: 100%;
//background-image: url("/assets/play/listen-read-circle/bg.jpg");
background: #ffffff;
background-repeat: no-repeat;
background-size: cover;
}
.read-and-point-copy {
width: 500px;
height: 85px;
object-fit: contain;
text-shadow: 0 6px 4px rgba(0, 0, 0, 0.5), 0 3px 0 #fffecc;
font-family: Questrian;
font-size: 72px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #f8e424;
}
.read-and-point-copy .text-style-1 {
font-size: 48px;
}
.read-and-point-copy .text-style-2 {
font-size: 64px;
}
// @font-face{
// font-family: 'BRLNSDB';
// src: url("../../assets/default/font/BRLNSDB.TTF") ;
// }
// @font-face{
// font-family: 'RoundedBold';
// src: url("../../assets/default/font/ArialRoundedBold.otf") ;
// }
// @font-face{
// font-family: 'BRLNSB_1';
// src: url("../../assets/default/font/BerlinSansFB/BRLNSB_1.TTF") ;
// }
// @font-face{
// font-family: 'BerlinSansFBDemi-Bold';
// src: url("../../assets/default/font/BerlinSansFB/BRLNSDB_1.TTF") ;
// }
// @font-face{
// font-family: 'BRLNSR_1';
// src: url("../../assets/default/font/BerlinSansFB/BRLNSR_1.TTF") ;
// }
// @font-face{
// font-family: 'GOTHIC_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHIC_1.TTF") ;
// }
// @font-face{
// font-family: 'GOTHICB_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHICB_1.TTF") ;
// }
// @font-face{
// font-family: 'GOTHICBI_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHICBI_1.TTF") ;
// }
// @font-face{
// font-family: 'GOTHICI_1';
// src: url("../../assets/default/font/CenturyGothic/GOTHICI_1.TTF") ;
// }
// @font-face{
// font-family: 'MMTextBook';
// src: url("../../assets/default/font/MMTextBook/MMTextBook.otf") ;
// }
// @font-face{
// font-family: 'MMTextBook-Bold';
// src: url("../../assets/default/font/MMTextBook/MMTextBook-Bold.otf") ;
// }
// @font-face{
// font-family: 'MMTextBook-BoldItalic';
// src: url("../../assets/default/font/MMTextBook/MMTextBook-BoldItalic.otf") ;
// }
// @font-face{
// font-family: 'MMTextBook-Italic';
// src: url("../../assets/default/font/MMTextBook/MMTextBook-Italic.otf") ;
// }
// @font-face{
// font-family: 'tt0142m';
// src: url("../../assets/play/font/tt0142m.ttf") ;
// }
@font-face{
font-family: 'Aileron-Black';
src: url("../../assets/play/font/Aileron-Black.ttf") ;
}
@font-face{
font-family: 'Aileron-Bold';
src: url("../../assets/play/font/Aileron-Bold.ttf") ;
}
@font-face{
font-family: 'DroidSansFallback';
src: url("../../assets/play/font/DroidSansFallback.ttf") ;
}
// @font-face{
// font-family: 'FuturaStd-Medium';
// src: url("../../assets/play/font/FuturaStd-Medium.otf") ;
// }
// @font-face{
// font-family: 'FuturaBT-Bold';
// src: url("../../assets/play/font/FuturaBT-Bold.otf") ;
// }
// @font-face{
// font-family: 'GOTHICB_1';
// src: url("../../assets/play/font/GOTHICB_1.ttf") ;
// }
This diff is collapsed.
const res = [
const localImages = {
'_bg_1280_720_Ruler': 'assets/default/images/1280_720_Ruler.png',
'_mask_layer_1280_720': 'assets/default/images/mask_layer_1280_720.png',
'_bg_240_180': 'assets/default/images/bg_240_180.png',
'_bg_453_251': 'assets/default/images/bg_453_251.png',
'_bg_1280_222': 'assets/default/images/bg_1280_222.png',
'_bg_1280_720': 'assets/default/images/bg_1280_720.png',
'_bg_200_200': 'assets/default/images/bg_200_200.png',
'_bg_30_30': 'assets/default/images/bg_30_30.png',
'_bg_500_600': 'assets/default/images/bg_500_600.png',
'_bg_50_50': 'assets/default/images/bg_50_50.png',
'_bg_75_50': 'assets/default/images/bg_75_50.png',
'_bg_50_20': 'assets/default/images/bg_50_20.png',
'_bg_75_50_black': 'assets/default/images/bg_75_50_black.png',
'_flag': 'assets/default/images/flag.png',
'_go': 'assets/default/images/go.png',
'_header': 'assets/default/images/header.png',
'_ready': 'assets/default/images/ready.png',
'_replay': 'assets/default/images/replay.png',
'_scrap-pic-1': 'assets/default/images/scrap-pic-1.png',
'_scrap-pic-2': 'assets/default/images/scrap-pic-2.png',
'_scrap-pic-3': 'assets/default/images/scrap-pic-3.png',
'_sm-pic-1': 'assets/default/images/sm-pic-1.png',
'_sm-pic-2': 'assets/default/images/sm-pic-2.png',
'_sm-pic-3': 'assets/default/images/sm-pic-3.png',
'_sm-pic-4': 'assets/default/images/sm-pic-4.png',
'_star': 'assets/default/images/star.png',
'_bubble': 'assets/default/images/bubble.png',
'_image_none': 'assets/default/images/image_none.png',
'_balloon_blue': 'assets/default/images/balloon_blue.png',
'_balloon_green': 'assets/default/images/balloon_green.png',
'_balloon_orange': 'assets/default/images/balloon_orange.png',
'_balloon_pink': 'assets/default/images/balloon_pink.png',
'_balloon_red': 'assets/default/images/balloon_red.png',
'_balloon_yellow': 'assets/default/images/balloon_yellow.png',
'bg_question': 'assets/play/bg_question.png',
'btn_next': 'assets/play/btn_next.png',
'btn_pre': 'assets/play/btn_pre.png',
'bg_main_mask': 'assets/play/bg_main_mask.png',
};
// ['bg', "assets/play/bg.jpg"],
['btn_left', "assets/play/btn_left.png"],
['btn_right', "assets/play/btn_right.png"],
// ['text_bg', "assets/play/text_bg.png"],
];
const localAudios = {
'sm-back': "assets/default/audio/sm-back.mp3",
'sm-display': "assets/default/audio/sm-display.mp3",
'sm-wrong': "assets/default/audio/sm-wrong.mp3",
'sm-win': "assets/default/audio/sm-win.mp3",
'sm-in': "assets/default/audio/sm-in.mp3",
'sm-out': "assets/default/audio/sm-out.mp3",
'sm-click': "assets/default/audio/sm-click.mp3",
'sm-start': "assets/default/audio/sm-start.mp3",
'sm-correct': 'assets/default/audio/sm-correct.mp3',
'sm-star': "assets/default/audio/sm-star.mp3",
'sm-choice-complete': 'assets/default/audio/sm-choice-complete.mp3',
'sm-choice-correct': 'assets/default/audio/sm-choice-correct.mp3',
'sm-choice-error': 'assets/default/audio/sm-choice-error.mp3',
'sm-choice-in': 'assets/default/audio/sm-choice-in.mp3',
'sm-choice-show-answer': 'assets/default/audio/sm-choice-show-answer.mp3',
'sm-choice-timeup-0': 'assets/default/audio/sm-choice-timeup-0.mp3',
'sm-choice-timeup-3': 'assets/default/audio/sm-choice-timeup-3.mp3',
'sm-go': 'assets/default/audio/sm-go.mp3',
'sm-ready': 'assets/default/audio/sm-ready.mp3',
'button': 'assets/play/sound/button.mp3',
'popup': 'assets/play/sound/popup.mp3',
'correct': 'assets/play/sound/correct.mp3',
};
const multiSizeBackground = {
const resAudio = [
}
['click', "assets/play/music/click.mp3"],
];
export {res, resAudio};
export { localImages, localAudios, multiSizeBackground };
\ No newline at end of file
This diff is collapsed.
import os
import json
def file_name(file_dir):
fileList =[]
for root, dirs, files in os.walk(file_dir):
fileList = files
return fileList
fileList = file_name(os.path.abspath('.'))
f = open('filename.txt', 'w')
for fn in fileList:
if fn.split(".")[0] != "creatJsonProfile":
f.write("'" + fn.split(".")[0] + "': 'assets/play/" + fn + "',\n")
f.close()
\ No newline at end of file
!function(){"use strict";function r(r){r||(r=Math.random),this.p=e(r),this.perm=new Uint8Array(512),this.permMod12=new Uint8Array(512);for(var t=0;t<512;t++)this.perm[t]=this.p[255&t],this.permMod12[t]=this.perm[t]%12}function e(r){var e,t=new Uint8Array(256);for(e=0;e<256;e++)t[e]=e;for(e=0;e<255;e++){var a=e+1+~~(r()*(255-e)),i=t[e];t[e]=t[a],t[a]=i}return t}var t=.5*(Math.sqrt(3)-1),a=(3-Math.sqrt(3))/6,i=1/3,o=1/6,n=(Math.sqrt(5)-1)/4,f=(5-Math.sqrt(5))/20;r.prototype={grad3:new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]),grad4:new Float32Array([0,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,1,0,1,1,1,0,1,-1,1,0,-1,1,1,0,-1,-1,-1,0,1,1,-1,0,1,-1,-1,0,-1,1,-1,0,-1,-1,1,1,0,1,1,1,0,-1,1,-1,0,1,1,-1,0,-1,-1,1,0,1,-1,1,0,-1,-1,-1,0,1,-1,-1,0,-1,1,1,1,0,1,1,-1,0,1,-1,1,0,1,-1,-1,0,-1,1,1,0,-1,1,-1,0,-1,-1,1,0,-1,-1,-1,0]),noise2D:function(r,e){var i,o,n=this.permMod12,f=this.perm,s=this.grad3,v=0,h=0,d=0,l=(r+e)*t,p=Math.floor(r+l),u=Math.floor(e+l),M=(p+u)*a,m=p-M,y=u-M,w=r-m,c=e-y;w>c?(i=1,o=0):(i=0,o=1);var g=w-i+a,x=c-o+a,A=w-1+2*a,q=c-1+2*a,D=255&p,U=255&u,b=.5-w*w-c*c;if(b>=0){var F=3*n[D+f[U]];b*=b,v=b*b*(s[F]*w+s[F+1]*c)}var N=.5-g*g-x*x;if(N>=0){var S=3*n[D+i+f[U+o]];N*=N,h=N*N*(s[S]*g+s[S+1]*x)}var P=.5-A*A-q*q;if(P>=0){var T=3*n[D+1+f[U+1]];P*=P,d=P*P*(s[T]*A+s[T+1]*q)}return 70*(v+h+d)},noise3D:function(r,e,t){var a,n,f,s,v,h,d,l,p,u,M=this.permMod12,m=this.perm,y=this.grad3,w=(r+e+t)*i,c=Math.floor(r+w),g=Math.floor(e+w),x=Math.floor(t+w),A=(c+g+x)*o,q=c-A,D=g-A,U=x-A,b=r-q,F=e-D,N=t-U;b>=F?F>=N?(v=1,h=0,d=0,l=1,p=1,u=0):b>=N?(v=1,h=0,d=0,l=1,p=0,u=1):(v=0,h=0,d=1,l=1,p=0,u=1):F<N?(v=0,h=0,d=1,l=0,p=1,u=1):b<N?(v=0,h=1,d=0,l=0,p=1,u=1):(v=0,h=1,d=0,l=1,p=1,u=0);var S=b-v+o,P=F-h+o,T=N-d+o,_=b-l+2*o,j=F-p+2*o,k=N-u+2*o,z=b-1+3*o,B=F-1+3*o,C=N-1+3*o,E=255&c,G=255&g,H=255&x,I=.6-b*b-F*F-N*N;if(I<0)a=0;else{var J=3*M[E+m[G+m[H]]];I*=I,a=I*I*(y[J]*b+y[J+1]*F+y[J+2]*N)}var K=.6-S*S-P*P-T*T;if(K<0)n=0;else{var L=3*M[E+v+m[G+h+m[H+d]]];K*=K,n=K*K*(y[L]*S+y[L+1]*P+y[L+2]*T)}var O=.6-_*_-j*j-k*k;if(O<0)f=0;else{var Q=3*M[E+l+m[G+p+m[H+u]]];O*=O,f=O*O*(y[Q]*_+y[Q+1]*j+y[Q+2]*k)}var R=.6-z*z-B*B-C*C;if(R<0)s=0;else{var V=3*M[E+1+m[G+1+m[H+1]]];R*=R,s=R*R*(y[V]*z+y[V+1]*B+y[V+2]*C)}return 32*(a+n+f+s)},noise4D:function(r,e,t,a){var i,o,s,v,h,d=(this.permMod12,this.perm),l=this.grad4,p=(r+e+t+a)*n,u=Math.floor(r+p),M=Math.floor(e+p),m=Math.floor(t+p),y=Math.floor(a+p),w=(u+M+m+y)*f,c=u-w,g=M-w,x=m-w,A=y-w,q=r-c,D=e-g,U=t-x,b=a-A,F=0,N=0,S=0,P=0;q>D?F++:N++,q>U?F++:S++,q>b?F++:P++,D>U?N++:S++,D>b?N++:P++,U>b?S++:P++;var T,_,j,k,z,B,C,E,G,H,I,J;T=F>=3?1:0,_=N>=3?1:0,j=S>=3?1:0,k=P>=3?1:0,z=F>=2?1:0,B=N>=2?1:0,C=S>=2?1:0,E=P>=2?1:0,G=F>=1?1:0,H=N>=1?1:0,I=S>=1?1:0,J=P>=1?1:0;var K=q-T+f,L=D-_+f,O=U-j+f,Q=b-k+f,R=q-z+2*f,V=D-B+2*f,W=U-C+2*f,X=b-E+2*f,Y=q-G+3*f,Z=D-H+3*f,$=U-I+3*f,rr=b-J+3*f,er=q-1+4*f,tr=D-1+4*f,ar=U-1+4*f,ir=b-1+4*f,or=255&u,nr=255&M,fr=255&m,sr=255&y,vr=.6-q*q-D*D-U*U-b*b;if(vr<0)i=0;else{var hr=d[or+d[nr+d[fr+d[sr]]]]%32*4;vr*=vr,i=vr*vr*(l[hr]*q+l[hr+1]*D+l[hr+2]*U+l[hr+3]*b)}var dr=.6-K*K-L*L-O*O-Q*Q;if(dr<0)o=0;else{var lr=d[or+T+d[nr+_+d[fr+j+d[sr+k]]]]%32*4;dr*=dr,o=dr*dr*(l[lr]*K+l[lr+1]*L+l[lr+2]*O+l[lr+3]*Q)}var pr=.6-R*R-V*V-W*W-X*X;if(pr<0)s=0;else{var ur=d[or+z+d[nr+B+d[fr+C+d[sr+E]]]]%32*4;pr*=pr,s=pr*pr*(l[ur]*R+l[ur+1]*V+l[ur+2]*W+l[ur+3]*X)}var Mr=.6-Y*Y-Z*Z-$*$-rr*rr;if(Mr<0)v=0;else{var mr=d[or+G+d[nr+H+d[fr+I+d[sr+J]]]]%32*4;Mr*=Mr,v=Mr*Mr*(l[mr]*Y+l[mr+1]*Z+l[mr+2]*$+l[mr+3]*rr)}var yr=.6-er*er-tr*tr-ar*ar-ir*ir;if(yr<0)h=0;else{var wr=d[or+1+d[nr+1+d[fr+1+d[sr+1]]]]%32*4;yr*=yr,h=yr*yr*(l[wr]*er+l[wr+1]*tr+l[wr+2]*ar+l[wr+3]*ir)}return 27*(i+o+s+v+h)}},r._buildPermutationTable=e,"undefined"!=typeof define&&define.amd&&define(function(){return r}),"undefined"!=typeof exports?exports.SimplexNoise=r:"undefined"!=typeof window&&(window.SimplexNoise=r),"undefined"!=typeof module&&(module.exports=r)}();
//# sourceMappingURL=simplex-noise.min.js.map
\ No newline at end of file
This diff is collapsed.
import os
import json
def file_name(file_dir):
fileList =["bg_kuang", "bg_kuang2", "bg_light"]
f = open('filename.txt', 'w');
blank = False
for root, dirs, files in os.walk(file_dir):
for fileName in files:
if root.split("\\")[-1]=="frame" or root.split("\\")[-1]=="sound" or root.split("\\")[-1]=="play" or (root.split("\\")[-1] in fileList):
blank = True
if root.split("\\")[-1] != "play":
f.write("'" + fileName.split(".")[0] + "': 'assets/play/" + root.split("\\")[-1] + "/" + fileName + "',\n")
else:
f.write("'" + fileName.split(".")[0] + "': 'assets/" + root.split("\\")[-1] + "/" + fileName + "',\n")
if blank:
f.write("\n")
blank = False
f.close()
fileList = file_name(os.path.abspath('.'))
'bg_card_4_1': 'assets/play/bg_card_4_1.png',
'bg_card_4_2': 'assets/play/bg_card_4_2.png',
'bg_card_4_3': 'assets/play/bg_card_4_3.png',
'bg_card_4_4': 'assets/play/bg_card_4_4.png',
'bg_card_6_1': 'assets/play/bg_card_6_1.png',
'bg_card_6_2': 'assets/play/bg_card_6_2.png',
'bg_card_6_3': 'assets/play/bg_card_6_3.png',
'bg_card_6_4': 'assets/play/bg_card_6_4.png',
'bg_card_6_5': 'assets/play/bg_card_6_5.png',
'bg_card_6_6': 'assets/play/bg_card_6_6.png',
'bg_text_target': 'assets/play/bg_text_target.png',
'bg_title_part': 'assets/play/bg_title_part.png',
'circle_h': 'assets/play/circle_h.png',
'circle_l': 'assets/play/circle_l.png',
'circle_r': 'assets/play/circle_r.png',
'creatJsonProfile': 'assets/play/creatJsonProfile.py',
'filename': 'assets/play/filename.txt',
'icon_audio_container': 'assets/play/icon_audio_container.png',
'icon_paly': 'assets/play/icon_paly.png',
'icon_pause': 'assets/play/icon_pause.png',
'num_icon_1': 'assets/play/num_icon_1.png',
'num_icon_2': 'assets/play/num_icon_2.png',
'num_icon_3': 'assets/play/num_icon_3.png',
'num_icon_4': 'assets/play/num_icon_4.png',
'num_icon_5': 'assets/play/num_icon_5.png',
'num_icon_6': 'assets/play/num_icon_6.png',
'part_number_bg': 'assets/play/part_number_bg.png',
'radio_inner': 'assets/play/radio_inner.png',
'radio_out': 'assets/play/radio_out.png',
'resizeImg': 'assets/play/resizeImg.py',
'button': 'assets/play/sound/button.mp3',
'correct': 'assets/play/sound/correct.mp3',
'popup': 'assets/play/sound/popup.mp3',
import os
import shutil
from PIL import Image
fileName = os.listdir('./')
withBorder = False
border_left = ""
border_right = ""
imageName = input("图片名:")
if input("是否包含边框? (y/n):")=="y":
withBorder = True
if withBorder:
border_left = input("左边框文件名:")
border_right = input("右边框文件名:")
number = int(input("数量:"))
if os.path.exists('./' + imageName + '/'):
shutil.rmtree('./' + imageName + '/')
os.mkdir('./' + imageName + '/')
pic = Image.open('./' + imageName + '.PNG')
width = pic.width
height = pic.height
f = open('./' + imageName + '/' + imageName + '_map.txt', 'w')
if withBorder:
borderImg_left, borderImg_right = Image.open('./' + border_left + '.PNG'), Image.open('./' + border_right + '.PNG')
for index in range(1, number):
newpic = pic.resize((width*index, height),Image.ANTIALIAS)
loc1, loc2, loc3 = (0, 0), (borderImg_left.width, 0), (borderImg_left.width +newpic.width, 0)
join_pic = Image.new('RGBA', (borderImg_left.width + newpic.width + borderImg_right.width, newpic.height))
join_pic.paste(borderImg_left, loc1)
join_pic.paste(newpic, loc2)
join_pic.paste(borderImg_right, loc3)
join_pic.save('./' + imageName + '/' + imageName + '_' + str(index) + 'x.PNG')
f.write('"' + str(width*index) + '": "' + imageName + '_' + str(index) + 'x",\n')
f.close()
else:
for index in range(1, number):
newpic = pic.resize((width*index, height),Image.ANTIALIAS)
newpic.save('./' + imageName + '/' + imageName + '_' + str(index) + 'x.PNG')
f.write('"' + str(width*index) + '": "' + imageName + '_' + str(index) + 'x",\n')
f.close()
\ No newline at end of file
This diff is collapsed.
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