Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / CreatePointLight Bug in AGK Studio?

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 8th Apr 2019 00:16
Greetings fellas.

Testing out the engine, trying to place a light source using:
light = CreatePointLight(0.0, 0.0, 0.0, 100.0, 255, 255, 255)

I keep getting the error:


Error:


I've tried both setting the light index variable inside the function and trying:
variable = CreatePointLight

Can anyone confirm if this is a bug or I'm just stupid.
I'm probably stupid...
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 8th Apr 2019 00:19
Ok this worked but stull tho....

Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 8th Apr 2019 00:25
OOOOOH jesus... because lights are like cameras, they have to be index by a number, light 1, 2,3 etc... That's why the variable worked. I set it to 1 so Light 1 gets created.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Sh4d0xx
9
Years of Service
User Offline
Joined: 5th Dec 2014
Location: United Kingdom
Posted: 8th Apr 2019 15:18
Wait. . . Do you mean that AppGameKit Studio supports 2D lights ?
Sh4xx
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 8th Apr 2019 15:45 Edited at: 8th Apr 2019 15:46
CreatePointLight( lightID, x, y, z, radius, red, green, blue ) is a 3D function so those point lights wont work on 2D sprites.

What he meant was that the CreatePointLight() function doesnt return an ID for the light that was "created" its one of the few functions that doesnt work that way so you have to explicitly give it a light ID to create.

AGK doesnt support 2D lighting on sprites with easy setup functions but you can wrap functions which apply a shader that allows you to create and set 2D light positions and apply those to sprites easily - so you get 2D lighting and even normal mapping etc.... Its just not as easy in 2D as the functions aren't built in so you need to apply a suitable shader yourself.
Sh4d0xx
9
Years of Service
User Offline
Joined: 5th Dec 2014
Location: United Kingdom
Posted: 8th Apr 2019 16:56
Quote: "CreatePointLight( lightID, x, y, z, radius, red, green, blue ) is a 3D function so those point lights wont work on 2D sprites.

What he meant was that the CreatePointLight() function doesnt return an ID for the light that was "created" its one of the few functions that doesnt work that way so you have to explicitly give it a light ID to create.

AGK doesnt support 2D lighting on sprites with easy setup functions but you can wrap functions which apply a shader that allows you to create and set 2D light positions and apply those to sprites easily - so you get 2D lighting and even normal mapping etc.... Its just not as easy in 2D as the functions aren't built in so you need to apply a suitable shader yourself."


Ok no problem ! Thanks
Sh4xx

Login to post a reply

Server time is: 2024-04-19 04:30:09
Your offset time is: 2024-04-19 04:30:09