Возникла проблема с переносом HUD из CE2 в CE3. В CryEngine 2 HUD полностью функционирует, включая шкалу энергии и шкалу здоровья, но как перенести этот же HUD но CryEngine 3.
VIDEO
Вот сам код Hud из CryEngine 2:
Нажмите сюда, чтобы узнать больше
Код
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
var m_health = 100;setHealth = function(_health)
{
var health = Math.floor((Math.max(_health,0)));
if (m_health!=health)
{
m_health = health;
healthbar.gotoAndStop(m_health);
}
health_percent.text = m_health;
if (m_health > 100)
{
health_percent.text = 100;
}
var red_text:Color = new Color(health_percent);
if (m_health < 20)
{
red_text.setRGB(0xCC0000);
}
else
{
red_text.setRGB(0x886039);
}
}
var m_energy = 100;
setEnergy = function(_energy)
{
var energy = Math.floor((Math.max(_energy,0)));
if (m_energy!=energy)
{
m_energy = energy;
energybar.gotoAndStop(m_energy);
}
energy_percent.text = m_energy;
if (m_energy > 100)
{
energy_percent.text = 100;
}
var red_text:Color = new Color(energy_percent);
if (m_energy < 20)
{
red_text.setRGB(0xCC0000);
}
else
{
red_text.setRGB(0x434F28);
}
}
setAmmo = function(_secammo,_clipammo,_clipsize, _inventoryammo, _grenadeammo, _grenadetype, _notvehicle)
{
var clipsize = _clipsize;
if (_notvehicle==true)
{
clip_ammo.text = _clipammo;
inventory_ammo.text = _inventoryammo;
grenade_ammo.text = _grenadeammo;
}
else
{
clip_ammo.text = _clipammo;
inventory_ammo.text = _secammo;
}
var red_ammo:Color = new Color(clip_ammo);
if (_clipammo <= _clipsize / 3 && clipsize != 0)
{
red_ammo.setRGB(0xCC0000);
}
else
{
red_ammo.setRGB(0x996600);
}
}
Код
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
var m_health = 100;setHealth = function(_health)
{
var health = Math.floor((Math.max(_health,0)));
if (m_health!=health)
{
m_health = health;
healthbar.gotoAndStop(m_health);
}
health_percent.text = m_health;
if (m_health > 100)
{
health_percent.text = 100;
}
var red_text:Color = new Color(health_percent);
if (m_health < 20)
{
red_text.setRGB(0xCC0000);
}
else
{
red_text.setRGB(0x886039);
}
}
var m_energy = 100;
setEnergy = function(_energy)
{
var energy = Math.floor((Math.max(_energy,0)));
if (m_energy!=energy)
{
m_energy = energy;
energybar.gotoAndStop(m_energy);
}
energy_percent.text = m_energy;
if (m_energy > 100)
{
energy_percent.text = 100;
}
var red_text:Color = new Color(energy_percent);
if (m_energy < 20)
{
red_text.setRGB(0xCC0000);
}
else
{
red_text.setRGB(0x434F28);
}
}
setAmmo = function(_secammo,_clipammo,_clipsize, _inventoryammo, _grenadeammo, _grenadetype, _notvehicle)
{
var clipsize = _clipsize;
if (_notvehicle==true)
{
clip_ammo.text = _clipammo;
inventory_ammo.text = _inventoryammo;
grenade_ammo.text = _grenadeammo;
}
else
{
clip_ammo.text = _clipammo;
inventory_ammo.text = _secammo;
}
var red_ammo:Color = new Color(clip_ammo);
if (_clipammo <= _clipsize / 3 && clipsize != 0)
{
red_ammo.setRGB(0xCC0000);
}
else
{
red_ammo.setRGB(0x996600);
}
}
А вот как все это перенести в CE3? Не могу понять.
Простейший HUD без шкалы смогу сделать, а вот со шкалой врядли получится.