forked from cping/LGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoadScreen.txt
172 lines (136 loc) · 3.6 KB
/
LoadScreen.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
JavaSE:
package org.test;
import loon.LSetting;
import loon.LazyLoading;
import loon.Screen;
import loon.javase.Loon;
public class Main {
public static void main(String[] args) {
LSetting setting = new LSetting();
setting.isFPS = true;
setting.isLogo = false;
setting.logoPath = "loon_logo.png";
// 原始大小
setting.width = 480;
setting.height = 320;
// 缩放为
setting.width_zoom = 640;
setting.height_zoom = 480;
setting.fps = 60;
setting.fontName = "黑体";
setting.appName = "test";
setting.emulateTouch = false;
Loon.register(setting, new LazyLoading.Data() {
@Override
public Screen onScreen() {
return new YourScreen();
}
});
}
}
Android:
package org.test;
import loon.Screen;
import loon.android.AndroidGame.AndroidSetting;
import loon.android.Loon;
public class MainActivity extends Loon {
@Override
public void onMain() {
AndroidSetting setting = new AndroidSetting();
setting.isFPS = true;
setting.isLogo = false;
setting.fullscreen = true;
setting.width = 480;
setting.height = 320;
//若启动此模式,则画面等比压缩,不会失真
setting.useRatioScaleFactor = false;
//强制一个显示大小(在android模式下,不填则默认全屏,此模式可能会造成画面失真)
//setting.width_zoom = getContainerWidth();
//setting.height_zoom = getContainerHeight();
//屏幕显示模式
//setting.showMode = LMode.FitFill;
setting.logoPath = "loon_logo.png";
setting.fps = 60;
setting.fontName = "黑体";
setting.appName = "test";
setting.emulateTouch = false;
register(setting, new Data() {
@Override
public Screen onScreen() {
return new YourScreen();
}
});
}
}
GWT:
package loon.test;
import loon.Screen;
import loon.html5.gwt.Loon;
import loon.html5.gwt.GWTGame.GWTSetting;
import loon.html5.gwt.GWTGame.Repaint;
public class Main extends Loon {
@Override
public void onMain() {
GWTSetting setting = new GWTSetting();
setting.fps = 60;
// source size
setting.width = 480;
setting.height = 320;
// target size
setting.width_zoom = 640;
setting.height_zoom = 480;
setting.repaint = Repaint.AnimationScheduler;
setting.isFPS = true;
setting.fontName = "黑体";
setting.rootId = "embed-loon.test.TestLoon";
//按屏幕缩放比例缩放
//setting.useRatioScaleFactor = true;
//当此项开启,并且gwt.xml中设置了loon.addtojs为true,会默认从js中加载资源
setting.jsloadRes = false;
//设置一个需要的初始化进度条样式(不填则默认)
//setting.progress = GWTProgressDef.newSimpleLogoProcess(setting);
register(setting, new Data() {
@Override
public Screen onScreen() {
return new YourScreen();
}
});
}
}
IOS(Robovm):
package org.test;
import loon.LSetting;
import loon.Screen;
import loon.robovm.Loon;
import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.uikit.UIApplication;
public class Main extends Loon {
@Override
public void onMain() {
LSetting setting = new LSetting();
setting.isFPS = true;
setting.isLogo = false;
setting.logoPath = "loon_logo.png";
setting.fps = 60;
// 原始大小
setting.width = 480;
setting.height = 320;
// 缩放为
setting.width_zoom = 640;
setting.height_zoom = 480;
setting.fontName = "黑体";
setting.appName = "test";
setting.emulateTouch = false;
register(setting, new Data() {
@Override
public Screen onScreen() {
return new ScreenTest();
}
});
}
public static void main(String[] args) {
try (NSAutoreleasePool pool = new NSAutoreleasePool()) {
UIApplication.main(args, null, Main.class);
}
}
}