How i did it.
Code: Select all
EnableExplicit
XIncludeFile "nautilus.pbi"
Macro RenderSun(_x_,_y_,_size_)
*engine\RenderBegin()
*sun_light\BlendMod (_x_,_y_,_size_ * 1.6,_size_ * 1.6,#True,$FFFFFF,rotate + 45)
*sun_light\BlendMod (_x_,_y_,_size_ * 1.8,_size_ * 1.8,#True,$FFFF33,-rotate)
*sun_core_1\BlendMod(_x_,_y_,_size_,_size_,#True,$BBBB88,-rotate)
*sun_core_1\BlendMod(_x_,_y_,_size_,_size_,#True,$FFFF88,-rotate / 2)
*sun_core_1\BlendMod(_x_,_y_,_size_,_size_,#True,$FFFF88,rotate)
*sun_core_2\BlendMod(_x_,_y_,_size_,_size_,#True,$BBBB88,rotate / 2)
*sun_core_2\BlendMod(_x_,_y_,_size_,_size_,#True,$888866,-rotate)
*engine\DrawText(470,500,"Sun Example",#True)
*engine\RenderEnd()
EndMacro
Procedure.i Main()
Protected *engine.NAUTILUS_ENGINE
Protected *sun_light.NAUTILUS_TEXTURE
Protected *sun_core_1.NAUTILUS_TEXTURE
Protected *sun_core_2.NAUTILUS_TEXTURE
Protected rotate.f
If nautilusVersion() = #NAUTILUS_VERSION
If OpenWindow(0,0,0,960,600,#Null$,#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
AddWindowTimer(0,0,20)
*engine = nautilusEngine(WindowID(0),WindowWidth(0),WindowHeight(0))
If *engine
*engine\RenderVSyncMode(#False)
*sun_light = *engine\CreateTexture(?sun_light)
*sun_core_1 = *engine\CreateTexture(?sun_core_1)
*sun_core_2 = *engine\CreateTexture(?sun_core_2)
Repeat
Select WaitWindowEvent()
Case #PB_Event_Timer
rotate + 0.1
RenderSun(470,260,280)
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
*engine\Release()
EndIf
CloseWindow(0)
EndIf
EndIf
ProcedureReturn #Null
EndProcedure
Main()
End
DataSection
sun_light:
IncludeBinary "sun_1.png" ;original by HalloweenNight: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
sun_core_1:
IncludeBinary "sun_2.png" ;original by Kevin Reardon: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
sun_core_2:
IncludeBinary "sun_3.png" ;original by Vasco M. J. Henriques and Ainar Drews: Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
EndDataSection
Put all files in the same Directory.
Hope this helps even thought i used my own gfx lib.
This ofc. can also be easily done with the PB 2d lib.