Help with Text and Sound
Moderator: Moderators
Help with Text and Sound
Hello ZGE community!
Please help me with those questions:
¿Is there a way to import .wav or .ogg files to Music component?
¿Why RenderText doesn't work on Android 4.3? The text displays very well under Windows but running it on Android shows nothing.
Thanks in advance!
Please help me with those questions:
¿Is there a way to import .wav or .ogg files to Music component?
¿Why RenderText doesn't work on Android 4.3? The text displays very well under Windows but running it on Android shows nothing.
Thanks in advance!
Re: Help with Text and Sound
Hi jonaspm,
K
Nope, you need to use a external library to play a .mp3 or .ogg file.jonaspm wrote:Is there a way to import .wav or .ogg files to Music component?
Are you using the built-in font?jonaspm wrote:Why RenderText doesn't work on Android 4.3? The text displays very well under Windows but running it on Android shows nothing.
K
The simplest way to play music is to use either Sunvox or Bass libraries. Both working on Windows and Android . ZGE contains adaptors to both libs; go to the OnLoaded section, activate context menu Add from library.../External libraris and select one of them.jonaspm wrote:Could you please refer me to that library?
Instead, you should use another bitmap font explicitly defined. The easiest possibility is to use the Dina font from library available in ZGE (use context menu in the project browser view Add from library.../Fonts/Dina). If needed, I'm creating own fonts with Codehead's Bitmap Font Generator (CBFG). There are some more tools for rasterization fonts but this one is the best regarding to the features I need.jonaspm wrote:Yes, i am using the built-in font.
Hi guys,
Keep in mind that Bass is only free for non-commercial use. And although i think SunVox is great, you can't play MP3 / Ogg files with it. Anyway, most operating systems come with MP3 / Ogg playback capabilities, so you could simply use that ( a Windows example is available here ). Otherwise, free alternatives to Bass include Audiere and OpenAL.
And Rado1 is right, the build-in font is only available on Windows
K
Keep in mind that Bass is only free for non-commercial use. And although i think SunVox is great, you can't play MP3 / Ogg files with it. Anyway, most operating systems come with MP3 / Ogg playback capabilities, so you could simply use that ( a Windows example is available here ). Otherwise, free alternatives to Bass include Audiere and OpenAL.
And Rado1 is right, the build-in font is only available on Windows
K
Thank you both, i really apreciate your words
BTW, i have another question, if you could help me i would be really happy
I want App.Camera to follow a model even when rotating, i mean, keep the camera away from the model X of radius and rotate through that radius as the model rotates...
here is a small screenshot of what i am saying xD
Also, i have problems with wireframe... the player's mesh shouldn't show as wireframe but the entire faces, the floor is the wireframe... not the ship... sometimes the ship turns "normal" and then "wireframe" when crossing the "0" value on Z
VIDEO:
http://www.2shared.com/video/r1CziNrX/V ... 33245.html
thanks in advance!
BTW, i have another question, if you could help me i would be really happy
I want App.Camera to follow a model even when rotating, i mean, keep the camera away from the model X of radius and rotate through that radius as the model rotates...
here is a small screenshot of what i am saying xD
Also, i have problems with wireframe... the player's mesh shouldn't show as wireframe but the entire faces, the floor is the wireframe... not the ship... sometimes the ship turns "normal" and then "wireframe" when crossing the "0" value on Z
VIDEO:
http://www.2shared.com/video/r1CziNrX/V ... 33245.html
thanks in advance!
- Attachments
-
- NEWars.zgeproj
- project file
- (242.96 KiB) Downloaded 466 times
-
- "normal view"
- zge.png (26.39 KiB) Viewed 15401 times
-
- "not normal view" (wireframe)
- zge2.png (35.41 KiB) Viewed 15401 times
Hi jonaspm,
K
Not exactly sure what you're after, but attached is a example. Use left mouse button to move forward.jonaspm wrote:I want App.Camera to follow a model even when rotating
You forgot to create & use a separate Material for your shipjonaspm wrote:i have problems with wireframe
K
- Attachments
-
- Ship.zgeproj
- (2.3 KiB) Downloaded 493 times
Hi jonaspm,
*Well, technically there is ( the Camera component ), but you can't switch Cameras mid-rendering. And you don't want to go multi-pass for these kind of situations either.
K
Unfortunately there's no build-in component specifically for that* However, you could simply use the RenderText component for GUI elements as well ( just use a Bitmap containing GUI elements instead of a Font ). Alternatively you can use the setMatrix function to switch to a proper 2D projection. Attached is a example.jonaspm wrote:Is there a way to keep an image or a sprite always in front of the Camera? Just like text does, because i'm having trouble creating an ingame-GUI in this game.
*Well, technically there is ( the Camera component ), but you can't switch Cameras mid-rendering. And you don't want to go multi-pass for these kind of situations either.
K
- Attachments
-
- Layer2D.zgeproj
- This is a updated version of the example i posted last year ( before setMatrix was available ).
- (24.48 KiB) Downloaded 511 times
Hi jonaspm,
Attached is a simple example how to use make clickable buttons .. in case you were going to ask that after this
K
Not really no. You can't ( comfortably ) use collision with the RenderText component. You want to use the setMatrix solution + individual Models for elements you want to interact with.jonaspm wrote:With the font solution, can i interact with it? Like clicking on it and changing AppState or something like that?
Attached is a simple example how to use make clickable buttons .. in case you were going to ask that after this
K
- Attachments
-
- Buttons.zgeproj
- (2.76 KiB) Downloaded 594 times
Kjell, just one detail - your Buttons project throws syntax error; so instead of should be written, for exampleThis is due to ZGE's inability (bug) to convert from byte.
Code: Select all
return Button[0] && !Button[1];
Code: Select all
return Button[0]!=0 && Button[1]==0;