Search found 12 matches

by Mijikai
Sun Feb 26, 2023 4:55 pm
Forum: Game Programming
Topic: When to call SpriteWidth() and SpriteHeight() ?
Replies: 4
Views: 12515

Re: When to call SpriteWidth() and SpriteHeight() ?

Thanks for the reply, the Sprite example in the Doc does not use Load() to load anything. Its just some load counter: Procedure Loading(Type, Filename$) Static NbLoadedElements NbLoadedElements+1 If NbLoadedElements = 1 ; Finished the loading of all images and sounds, we can start the applications F...
by Mijikai
Sun Feb 26, 2023 3:24 pm
Forum: Game Programming
Topic: When to call SpriteWidth() and SpriteHeight() ?
Replies: 4
Views: 12515

When to call SpriteWidth() and SpriteHeight() ?

When and where can i request the size of an sprite? What i tried: EnableExplicit Global s.i Procedure.i Load() FlipBuffers() EndProcedure Procedure.i Update() ClearScreen($333344) DisplayTransparentSprite(s,0,0) FlipBuffers() EndProcedure Procedure.i Render() If OpenWindow(0,0,0,256,256,#Null$,#PB_W...
by Mijikai
Sun Feb 26, 2023 9:48 am
Forum: Coding Questions
Topic: Transparency with Sprites and 2D Drawing?
Replies: 0
Views: 8619

Transparency with Sprites and 2D Drawing?

Is there a way to get transparency working with 2D Drawing on Sprites (with alpha channel) ?
by Mijikai
Sat Feb 25, 2023 7:25 pm
Forum: Coding Questions
Topic: How to use pointers?
Replies: 1
Views: 901

How to use pointers?

What am i missing?

Code (return values via pointers):

Code: Select all

EnableExplicit

Procedure.i Mouse(*X.Float,*Y.Float)
  *X\f = 123.0
  *Y\f = 456.0
  ProcedureReturn #Null
EndProcedure

Procedure.i Main()
  Protected x.f
  Protected y.f
  Mouse(@x,@y)
  Debug x
  Debug y
EndProcedure

Main()
by Mijikai
Sat Feb 25, 2023 7:23 pm
Forum: Coding Questions
Topic: How to use interfaces?
Replies: 4
Views: 1266

Re: How to use interfaces?

Thanks for the reply.
by Mijikai
Sat Feb 25, 2023 1:45 pm
Forum: Coding Questions
Topic: How to use interfaces?
Replies: 4
Views: 1266

Re: How to use interfaces?

I mainly use PB so i guess its just different.

Datasection example:

Code: Select all

Debug ?label;<- does not exist

DataSection
  label:
EndDataSection
by Mijikai
Sat Feb 25, 2023 10:25 am
Forum: Coding Questions
Topic: How to use interfaces?
Replies: 4
Views: 1266

How to use interfaces?

I need some oop for a game so i naturally tried to use interfaces for objects just like in PB. Seems like its not possible... how would i solve this problem? Btw. labes in the datasection did not work, thats why i moved the vtable into a struct. What i tried: EnableExplicit Structure DUMMY *vt value...
by Mijikai
Mon Sep 18, 2017 5:05 pm
Forum: Coding Questions
Topic: [Help] Converting code from PureBasic!
Replies: 7
Views: 3740

Re: [Help] Converting code from PureBasic!

Try using AllocateStructure instead of AllocateMemory - by the looks of it, the latter is only to be used with Poke and Peek, whilst the former is for structures. ... Also dont forget that structures in SpiderBasic are actually functions, with added code in. I suspect what is happening, is although...
by Mijikai
Sun Sep 17, 2017 11:19 am
Forum: Coding Questions
Topic: [Possible Bug ] Pointers & Structures
Replies: 2
Views: 2495

[Possible Bug ] Pointers & Structures

Maybe its just me - but there could be a bug !

Testcode (SpiderBasic 2.10 - Demo):
http://forums.spiderbasic.com/viewtopic ... 1282#p4439
by Mijikai
Sun Sep 17, 2017 11:13 am
Forum: Coding Questions
Topic: [Help] Converting code from PureBasic!
Replies: 7
Views: 3740

Re: [Help] Converting code from PureBasic!

falsam wrote:I think there is a bug with the pointers of structures.

....
Thanks for your reply.
I just saw it when i had posted my suspicion about a possible bug,
If that is the case SpiderBasic is not safe to use - ill only continue my endeavour once this issue is resolved.