Search found 1644 matches

by Kjell
Sun Jul 01, 2018 10:30 pm
Forum: General discussion
Topic: Particles with Gravity.Z
Replies: 5
Views: 141

Re: Particles with Gravity.Z

Hi Ats, Anyway, here's my new missile that creates smoke as models. Is that ok? Or would it be too heavy? That's certainly not the most lightweight approach to particles ( using a model per particle ). But as long as your game runs at the desired frame-rate on the weakest hardware that you want to s...
by Kjell
Sun Jul 01, 2018 11:09 am
Forum: General discussion
Topic: Particles with Gravity.Z
Replies: 5
Views: 141

Re: Particles with Gravity.Z

Hi Ats,

Agreed .. as long as the Z component isn't used, there shouldn't be a field for it in the editor either. It is mentioned on the help page though :wink:

K
by Kjell
Sun Jul 01, 2018 9:26 am
Forum: General discussion
Topic: Particles with Gravity.Z
Replies: 5
Views: 141

Re: Particles with Gravity.Z

Hi Ats, RenderParticles is a 2D-only component .. which means that the Z component* of the Gravity property is ignored. And even when you disable the FollowModel property particles still follow the model from which they are spawned on the Z-axis ( see demonstration example below ). <?xml version=&qu...
by Kjell
Sat Jun 30, 2018 11:42 am
Forum: General discussion
Topic: Global to local rotation
Replies: 3
Views: 140

Re: Global to local rotation

Hi Ats, By the way, using Axis instead of ButtonLeft/Right is clever to avoid pressing both opposite direction at the same time, among other things. I'll change my game to use it like that. (Edit: maybe not finaly, I also have to test press/release to avoid key repeat ) Check the example in this pos...
by Kjell
Sat Jun 30, 2018 12:31 am
Forum: General discussion
Topic: Global to local rotation
Replies: 3
Views: 140

Re: Global to local rotation

Hi Ats, I've been trying to rotate a model from the world viewpoint for hours instead of rotating from his local axes. The easiest way to do that is as follows ( use the arrow keys to rotate ) .. no quaternions needed :wink: <?xml version="1.0" encoding="iso-8859-1" ?> <ZApplicat...
by Kjell
Fri Jun 29, 2018 9:42 am
Forum: Tips'n'Tricks
Topic: Simple GLSL fog,. also good for simple darkness lighting,.
Replies: 11
Views: 2621

Re: Simple GLSL fog,. also good for simple darkness lighting,.

Hi Ats, Not exactly sure what's wrong .. i suspect you're not loading the OpenGL ES library correctly, but who knows. Anyway, can you try the following example? I tested it on a Android device and it works properly. <?xml version="1.0" encoding="iso-8859-1" ?> <ZApplication Name=...
by Kjell
Thu Jun 28, 2018 8:23 pm
Forum: Tips'n'Tricks
Topic: Simple GLSL fog,. also good for simple darkness lighting,.
Replies: 11
Views: 2621

Re: Simple GLSL fog,. also good for simple darkness lighting,.

Hi Ats,

On Android you need to use glFogx instead of glFogi :wink:

K
by Kjell
Thu Jun 28, 2018 4:22 pm
Forum: Tips'n'Tricks
Topic: Simple GLSL fog,. also good for simple darkness lighting,.
Replies: 11
Views: 2621

Re: Simple GLSL fog,. also good for simple darkness lighting,.

Hi Ats,

Ats wrote:Your fog is simple and perfect for the ships, but it hides my starfield in the background as it is applied to everything.

You can simply disable the fog before rendering your starfield using "glDisable(GL_FOG)" and then enable it again afterwards.

K
by Kjell
Thu Jun 28, 2018 1:36 pm
Forum: Tips'n'Tricks
Topic: Simple GLSL fog,. also good for simple darkness lighting,.
Replies: 11
Views: 2621

Re: Simple GLSL fog,. also good for simple darkness lighting,.

Hi Ats, Quick question .. do you use / need shaders in your project? If not, you can enable fog using OpenGL calls without having to resort to shaders .. check out the following example. <?xml version="1.0" encoding="iso-8859-1" ?> <ZApplication Name="App" Caption="...
by Kjell
Wed Jun 27, 2018 12:57 pm
Forum: General discussion
Topic: Touch happens on release instead of on press (Android)
Replies: 7
Views: 263

Re: Touch happens on release instead of on press (Android)

Hi Ats, By the way, can I handle all the controls test (keyboard, mouse, gamepad) in App - ZApplication / OnUpdate instead of making the same tests over and over again in different AppStates? I won't have bad surprises with reactivity or something else? There's no difference in performance between p...
by Kjell
Mon Jun 25, 2018 7:29 pm
Forum: General discussion
Topic: Touch happens on release instead of on press (Android)
Replies: 7
Views: 263

Re: Touch happens on release instead of on press (Android)

Hi Ats, App.MousePosition.X is moving between -1 and 1. But what about touchGetX? Should be the same, i double-checked the source ... touchGetX/Y ( ZExpressions.pas ) calls Platform_TouchGetPos ( ZPlatform_Android.inc ) to retrieve the pixel-coordinates of a touch-event and then uses NormalizeToScre...
by Kjell
Mon Jun 25, 2018 6:13 pm
Forum: General discussion
Topic: Touch happens on release instead of on press (Android)
Replies: 7
Views: 263

Re: Touch happens on release instead of on press (Android)

Hi Ats,

On Android you should use the touchGetCount, touchGetX, touchGetY and touchGetID functions to properly deal with touch events.

K
by Kjell
Mon Jun 25, 2018 5:05 pm
Forum: General discussion
Topic: Pausing
Replies: 9
Views: 785

Re: Pausing

Hi, Pausing the game in preview mode deactivates the ModelUpdatesEnabled property of the AppState componant. It's weird, but it's not a bug in the game. I'd recommend putting a ZExpression in App.OnClose that resets the ModelUpdatesEnabled property of your AppState(s) so you don't have to think abou...
by Kjell
Fri Jun 22, 2018 1:57 am
Forum: General discussion
Topic: Pausing
Replies: 9
Views: 785

Re: Pausing

Hi Ats, I've been using ( variations of ) the following approach for as long as i can remember .. <?xml version="1.0" encoding="iso-8859-1" ?> <ZApplication Name="App" Caption="ZGameEditor application" ClearColor="0.5 0.5 0.5 1" FileVersion="2&q...
by Kjell
Thu Jun 21, 2018 11:05 pm
Forum: General discussion
Topic: Pausing
Replies: 9
Views: 785

Re: Pausing

Hi Ats, How do you toggle the AppState "ModelUpdatesEnabled" from a ZExpression? You can use the following expression .. MyAppState.ModelUpdatesEnabled = MyAppState.ModelUpdatesEnabled ? 0 : 1; Below is a simple example ( press space-bar to toggle ) :wink: <?xml version="1.0" enc...

Go to advanced search