3DGameMarket.net
Productos relacionados con Gamestudio y desarrollo de juegos en 3D.

Subtitles system

This subtitles system allow you to easily implement subtitles on your games. It provide a function named ent_say that allow you to play a sound with simple mouth and talk animations (when requested) and show using the TEXT type. It is just to call this function.

Product Details

Subtitles position are automatically adjusted to avoid being out of screen or overlapping another. You can set the approximate line size. When necessary the algorithm try to cut subtitles on the right place, these subtitles continue on the next line.

You can set the ent_say flags to show an subtitle after another, or to show two subtitles for the case of two characters talking at same time. These subtitles have two different colors. See the source code below for details.

Relevant source code from demo:

#include "subtitles1.h"

SOUND* hello = "hello.ogg";
SOUND* hi = "hi.ogg";
SOUND* where_i_can = "where_i_can.ogg";
SOUND* not_disturb = "please_not_disturb.ogg";

[...]

function main() {
[...]
	/* FANM_MOUTH means that plays the mouth animation */
	/* With FSAY_SYNC, the function will only return
		when the sound stop playing. Otherwise if there
		is an available subtitle (of two) will show it
		and play another sound. */

	while(1) {
		ent_say( bird, hello, "hello!", 100, FANM_MOUTH | FSAY_SYNC );
		ent_say( bird2, hi, "hi.", 100, FANM_MOUTH | FSAY_SYNC );
		ent_say( bird, where_i_can, "You know where I can...", 100, FANM_MOUTH  );
		wait(-1.7);
		ent_say( bird2, not_disturb, "Please not disturb!", 100, FANM_MOUTH );
		wait(-4);
	}
}

The readme file:

This is a subtitle system using "TEXT*" created and
tested with Gamestudio A8. To use it include subtitles1.h
in your Lite-C code. It allow you to easily insert subtitles
on your game. See the demo and the source code comments
for more details.

Note:
The original bird model is in public domain, it's texture too.
I claim no copyright about the present modifications to the
original bird model.

This is an product of: http://3dgamemarket.net/

Included files:
* bird.mdl - A simple bird with a very simple
rigging. Used for the demo.
* hello.ogg, hi.ogg, please_not_disturb.ogg,
where_i_can.ogg - Some audio used in the demo.
* demo1.c - A demo.
* subtitles1.c - The subtitle system.
* subtitles1.h - The file written to be include.

The features are:
* Support for two subtitles with two different colors
to represent two characters speaking at same time.
(works when not using the FSAY_SYNC flag)

* You can adjust subtitle position using sub1_pos or
sub2_pos vectors. But when possible subtitles are
adjusted to avoid overlapping another and being
out of screen.

* Subtitles can be disabled setting DISABLE_SUBTITLES to 1.

* Line break is automatically inserted. When necessary the
script will automatically search the "neighborhood" spaces
to be replaced by a line break. You can adjust the size of
the "neighborhood" using the variable FSEARCH_LIMIT. By
Increasing the value of this variable the lines are
potentially longer.

* If there is no spaces in the "neighborhood", the words are
automatically cutted with "-" and continue on the next line.
Note that the algorithm try to found a suitable place to cut
words.

* If you want, animations can be played while a character
says something. (use the FANM_MOUTH and FANM_TALK flags).
The model should have "mouth" and "talk" animations.

* In case you put two subtitles in the same place or when not
have enough space, their position is automatically adjusted.
You is able prioritize display one below the other
(SUB_MODE = F_Y_AXIS), or side by side (SUB_MODE = F_X_AXIS).

* When you not want two characters to talk at same time, you can
use FSAY_SYNC in "ent_say" "anim_flags". Then the "function"
will only return when them stop talking.

* You can set animation speed with FSAY_ANIM_SPEED.

* You can set SUB_LINE_SIZE to the size of the lines do not
be much over or less the given value.

* It uses ANM_ADD, then supports combining with other animations.

Follow Us


Google+
Seguir por email:


Language:

Advertisements:

Free Web Hosting



Menor resolución recomendada: 800x600.
Términos de servicio · Contáctenos!

Advertisements:




Menor resolución recomendada: 800x600.
Términos de servicio · Contáctenos!