Displaying images mid-game
Posted: Fri Oct 12, 2012 2:53 pm
It seems like you can only start and end the game with cinematics. So if you want to do things like display a level heading as someone enters the level, or have 2D art displayed on screen, it seems like a different trick is needed.
My thought on this was to use the ability of the game to render a 'screenEffect' for certain spell effects. For instance, the full-screen flames you see when you're hit with a fireburst. So the idea is to make a new particle system for a screenEffect that would display text, and attach it to a spell effect that can produce a screenEffect (preferably without causing damage, but that can be gotten around using disable tricks or an OnDamage hook).
Here screen1.tga (screen1.dds) is a texture I've defined to display some text headings.
So far so good, I've managed to render the custom screenEffect. The problem is, it always seems to occur at a random angle. This is true regardless of what I set sprayAngle to. Any idea how to pin down the angle and make it fixed, or is this a dead end?
My thought on this was to use the ability of the game to render a 'screenEffect' for certain spell effects. For instance, the full-screen flames you see when you're hit with a fireburst. So the idea is to make a new particle system for a screenEffect that would display text, and attach it to a spell effect that can produce a screenEffect (preferably without causing damage, but that can be gotten around using disable tricks or an OnDamage hook).
Here screen1.tga (screen1.dds) is a texture I've defined to display some text headings.
Code: Select all
defineParticleSystem{
name = "flash_screen_1",
emitters = {
{
spawnBurst = true,
emissionRate = 1,
emissionTime = 0,
maxParticles = 1,
boxMin = {0,0,2},
boxMax = {0,0,2},
sprayAngle = {60,60},
velocity = {0,0},
texture = "mod_assets/textures/screen1.tga",
lifetime = {5.0, 5.0},
colorAnimation = false,
color0 = {1, 1, 1},
opacity = 1.0,
fadeIn = 1.0,
fadeOut = 5.0,
size = {2.3, 2.3},
gravity = {0,0,0},
airResistance = 1,
rotationSpeed = 0,
blendMode = "Translucent",
objectSpace = true,
}
}
}
defineObject{
name = "textburst1",
class = "BurstSpell",
screenEffect = "flash_screen_1",
particleSystem = "torch",
lightColor = vec(0.75, 0.4, 0.25),
lightBrightness = 40,
lightRange = 4,
sound = "fireburst",
attackPower = 0,
damageType = "fire",
--cameraShake = true,
tags = { "spell" },
}
So far so good, I've managed to render the custom screenEffect. The problem is, it always seems to occur at a random angle. This is true regardless of what I set sprayAngle to. Any idea how to pin down the angle and make it fixed, or is this a dead end?