Search found 40 matches

by Andy
Sun Apr 02, 2023 2:08 pm
Forum: Coding Questions
Topic: Rotate Image
Replies: 1
Views: 977

Re: Rotate Image

You can already rotate a sprite with RotateSprite(#Sprite, Angle.f, Mode) This is very limited for game. It is nice if we can do anything in SpriteOutput like on openscreen Openscreen and the sprite commands are designed for speed/games. Spiderbasic has inline javascript so maybe you can modify this...
by Andy
Thu Mar 16, 2023 7:57 am
Forum: Javascript
Topic: More library loading problems
Replies: 0
Views: 12990

More library loading problems

This time, i am trying to load the Tuna library but i get a "Tuna is not defined error" ! $("<script src='https://cdnjs.cloudflare.com/ajax/libs/tunajs/1.0.4/tuna-min.js'></script>").appendTo("head"); Procedure ButtonHandler() ! var context = new AudioContext() ! var tu...
by Andy
Wed Mar 15, 2023 8:28 pm
Forum: Coding Questions
Topic: Static keyword confusion
Replies: 5
Views: 1591

Re: Static keyword confusion

Looks like arrays are also missing
by Andy
Tue Mar 14, 2023 2:08 pm
Forum: Coding Questions
Topic: Static keyword confusion
Replies: 5
Views: 1591

Re: Static keyword confusion

Thanks Peter. Is this stuff documented anywhere?
by Andy
Tue Mar 14, 2023 6:58 am
Forum: Coding Questions
Topic: Static keyword confusion
Replies: 5
Views: 1591

Static keyword confusion

Procedure ButtonHandler() Static value If value = 0 value = 20 EndIf ! console.log(v_value) EndProcedure If OpenWindow(0, 0, 0, 300, 440, "Test", #PB_Window_ScreenCentered) ButtonGadget(0, 10, 10, 280, 30, "Click Me") BindGadgetEvent(0, @ButtonHandler()) EndIf When I use the Sta...
by Andy
Wed Mar 08, 2023 5:41 am
Forum: Javascript
Topic: Javascript script not loading
Replies: 2
Views: 3712

Re: Javascript script not loading

Hi Peter, thanks for the solution. Can you tell me how you figured that out?

Regards.
by Andy
Tue Mar 07, 2023 7:06 pm
Forum: Javascript
Topic: Javascript script not loading
Replies: 2
Views: 3712

Javascript script not loading

Hi all I am trying to use the Tonejs audio framework but it does not seem to load. I get an error telling me Tone is not defined. Can anyone help? ! require(["https://cdnjs.cloudflare.com/ajax/libs/tone/14.8.49/Tone.min.js"]); Procedure ButtonHandler() ! Tone.start(); EndProcedure OpenWind...
by Andy
Sat Jan 22, 2022 10:44 am
Forum: Coding Questions
Topic: Strange problem with storing javascript buffer pointers in a list
Replies: 0
Views: 2063

Strange problem with storing javascript buffer pointers in a list

see code comments for details Structure samples buffer.l EndStructure Global NewList sample.samples(), audioctx Procedure ButtonHandler() Static audioinit If audioinit = 0 audioinit = 1 ! const AudioContext = window.AudioContext || window.webkitAudioContext ! v_audioctx = new AudioContext({latencyHi...
by Andy
Thu Jan 20, 2022 4:52 pm
Forum: Javascript
Topic: The File System Access API
Replies: 1
Views: 4919

The File System Access API

Can anyone point me in the right direction? I tried a couple of things but it wont work. Procedure ButtonHandler() gid = GadgetID(0) !let directory !document.getElementById(v_gid.gadget.id).addEventListener('click', async () => { ! try { ! directory = await window.showDirectoryPicker({ ! startIn: 'd...
by Andy
Sat Jan 16, 2021 10:41 am
Forum: Javascript
Topic: SVG Dropshadow
Replies: 0
Views: 5603

SVG Dropshadow

Does anyone know how to apply a drop shadow to vector drawings? Procedure GadgetEvents() Select EventGadget() Case 0 If EventType() = #PB_EventType_LeftButtonDown EndIf If EventType() = #PB_EventType_MouseMove; And GetGadgetAttribute(0, #PB_Canvas_Buttons) & #PB_Canvas_LeftButton EndIf EndSelect...