It is currently Fri Jul 10, 2020 5:10 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Transer Lib
PostPosted: Fri Aug 24, 2018 10:13 am 
Offline
User
User
User avatar

Joined: Sun Jun 24, 2018 12:28 pm
Posts: 34
Location: Holland
Hey 2D Programmers...,

I get here an simple library, called to draw simple 2d radial circles... with given it an count...
Here is the source code, don't edit them.




Source Code:
Code:
;***************************************************************************************************************************
;* Transer.pbi - Version 1.0 ***********************************************************************************************
;***************************************************************************************************************************
;***************************************************************************************************************************
Global X.i = 0
Global Y.i = 0
Global Between.i = 0
Global Radius.i = 0
Global Rotation.i = 0
Global Wave.i = 0
Global Colour.i = 0




;Transer_Circle(X, Y, Between, Radius, Rotation, Count, Colour)
Procedure Transer_Circle_Defeult(X, Y, Between, Radius, Rotation, Count, Colour)
 
  For I = 1 To Count
    Circle(X + (Between * (I * Cos(Radian(Rotation)))),
           Y + (Between * (I * Sin(Radian(Rotation)))), Radius, Colour)
  Next
 
EndProcedure



;Transer_Circle_Wave(X, Y, Between, Radius, Rotation, Wave, Limit, Count, Colour)
Procedure Transer_Circle_Wave(X, Y, Between, Radius, Rotation, Wave, Count, Colour)
 
  For I = 1 To Count
    Circle(X + (I * (Wave * Cos(Radian(Rotation)))),
           Y + (I * (Wave * Sin(Radian(Rotation)))), Radius, Colour)
  Next
 
EndProcedure
;Transer_Circle_Diffrence(X, Y, Between, Radius, Rotation, Diffrence, Count, Colour)



Procedure Transer_Circle_Diffrence(X, Y, Between, Radius, Rotation, Diffrence, Count, Colour)
 
  For I = 1 To Count
    Circle(X + (Between * (I * Cos(Radian(Rotation * (I * Diffrence))))),
           Y + (Between * (I * Sin(Radian(Rotation * (I * Diffrence))))), Radius, Colour)
  Next
 
EndProcedure



;Transer_Circle_Bow(X, Y, Between, Radius, Rotation, Diffrence, Count, Colour)
Procedure Transer_Circle_Bow(X, Y, Between, Radius, Rotation, Diffrence, Count, Colour)
 
  For I = 0 To Count
    Circle(X + (Between * (I * Cos(Radian(Rotation + (I * Diffrence))))),
           Y + (Between * (I * Sin(Radian(Rotation + (I * Diffrence))))), Radius, Colour)
  Next
 
EndProcedure



;Transer_Circle_Angle(X, Y, Between, Radius, Rotation, Angle, Count, Colour)
Procedure Transer_Circle_Angle(X, Y, Between, Radius, Rotation, Angle, Count, Colour)
 
  For I = 1 To Count
    Circle(X + (Between * Cos(Radian(Rotation + (Angle * I/Count)))),
           Y + (Between * Sin(Radian(Rotation + (Angle * I/Count)))), Radius, Colour)
  Next
 
EndProcedure



;***************************************************************************************************************************



Demo Script:
Code:
;******************************************************************************************************
;* Transer Demo 1.0 ************************************************************************************
;******************************************************************************************************


;Import Transer Lib (*.pbi)
XIncludeFile "Transer.pbi"


;Call Rotation Value
Global Rot.i = 0
Global Wave.i = 0
Global Dir.b = 1

;Call Procedure, called Initialize2D
Procedure Initialize2D()
 
  ;Initialize Sprite
  If InitSprite() = 0
    MessageRequester("Fout!", "Kan Sprites niet initializeren!", #PB_MessageRequester_Info)
    End
  EndIf
 
  ;Initializeer Keyboard
  If InitKeyboard() = 0
    MessageRequester("Fout!", "Kan Keyboard niet Initializeren", #PB_MessageRequester_Info)
    End
  EndIf
 
  ;Open Scherm
  If OpenScreen(800, 600, 32, "") = 0
    MessageRequester("Fout!", "Kan Scherm niet Openen", #PB_MessageRequester_Info)
    End
  EndIf
 
EndProcedure


Initialize2D()





Wave * Dir

Repeat
 
  ;Draw Radian Circles
  ClearScreen(0)
  StartDrawing(ScreenOutput())
  Transer_Circle_Defeult(200, 200, 10, 5, Rot, 10, RGB(255, 0, 0))
  Transer_Circle_Diffrence(200, 400, 10, 5, Rot, 1, 10, RGB(0, 255, 0))
  Transer_Circle_Bow(300, 300, 10, 5, Rot, 20, 10, RGB(255, 0, 255))
  Transer_Circle_Wave(500, 300, 10, 5, Rot, Wave, 10, RGB(255, 255, 0))
  Transer_Circle_Angle(600, 400, 100, 5, Rot, 360, 32, RGB(0, 0, 255))
  StopDrawing()
  FlipBuffers()
 
  ;Set Rotation to + 1
  Rot + 1
 
  Wave + (Dir * 1)
  If Wave <= 0 Or Wave >= 32
    Dir = -Dir
  EndIf
 
  ;Exit the demo
  ExamineKeyboard()
  If KeyboardPushed(#PB_Key_Escape)
    End
  EndIf
 
ForEver

;********************************************************************************************************


Quote:
Features:
1) Draw Circles on right in an line with rotate it
2) Draw Circles on right in an line with rotate it given it an diffrence value per/circle
3) Draw Circles in an given degrees with rotate it
4) Draw Circles in an wave transformation
5) Draw Circles in an bow


Quote:
Planned Features 1.1:
1) Draw more Shapes
2) Inner Rotation


Quote:
Fixed Bugs:
1) StartDrawing..., StopDrawing called in each function...., now you must do call they functions self




This source code is writted by Jamie van Cadsand... you can copy it and paste this in PureBasic...
Version Requered: 5.62..., Jamie


Last edited by JamieVanCadsand on Sun Aug 26, 2018 2:03 pm, edited 7 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Radial Circle Library
PostPosted: Fri Aug 24, 2018 10:41 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 554
Location: Germany, Saarbrücken
I don't get it. What is this even doing? Can you give an example?

Maybe you should consider to translate your language into English with DeepL. Then it would be more easy to understand what you are trying to say. ;-)

_________________
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.


Top
 Profile  
Reply with quote  
 Post subject: Re: Radial Circle Library
PostPosted: Fri Aug 24, 2018 11:21 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 686
I dont really get what this is supposed to do (i also dont see a library anywhere).
However i suggest this -> dont use StartDrawing() / StopDrawing() in every drawing function (unless u have a good reason).

:?:
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Radial Circle Library
PostPosted: Fri Aug 24, 2018 3:42 pm 
Offline
User
User
User avatar

Joined: Sun Jun 24, 2018 12:28 pm
Posts: 34
Location: Holland
Mijikai wrote:
I dont really get what this is supposed to do (i also dont see a library anywhere).
However i suggest this -> dont use StartDrawing() / StopDrawing() in every drawing function (unless u have a good reason).

:?:
Image


My bug is fixed..., now i get also the demo script...,
Jamie.


Top
 Profile  
Reply with quote  
 Post subject: Re: Radian Lib
PostPosted: Sat Aug 25, 2018 7:57 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 853
Location: Denmark
Copyright and no editing "the script".
You do know that this is extremely basic math, right? :wink:

_________________
“Tell me and I forget. Teach me and I remember. Involve me and I learn.”
— Benjamin Franklin
Current configurations: Windows 10, Intel 6800K, GeForce Gtx 1060, 32 gb ram.


Top
 Profile  
Reply with quote  
 Post subject: Re: Transer Lib
PostPosted: Mon Aug 27, 2018 6:51 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 8:51 am
Posts: 1483
Location: Germany
JamieVanCadsand wrote:
...
I get here an simple library, called to draw simple 2d radial circles... with given it an count...
Here is the source code, don't edit them.
...
This source code is writted by Jamie van Cadsand... you can copy it and paste this in PureBasic...
Version Requered: 5.62..., Jamie

@JamieVanCadsand
I see no usubility in this simple library. Any examples? Games? Another ideas for using it?
And why a copyright? For what?

_________________
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...


Top
 Profile  
Reply with quote  
 Post subject: Re: Transer Lib
PostPosted: Tue Aug 28, 2018 3:09 pm 
Offline
User
User
User avatar

Joined: Mon Feb 26, 2018 10:41 pm
Posts: 91
Location: Netherlands
Guys....

For the people who do not know who this person is:
Jamie is starter in PureBasic and his learning curve is very slow. He does understand the basic work but not all the way. All things around the gaming is unknown by him. So he was thinking that the copyright was somthing else. I explained it to him and now he under stand. All his work he make is under GNU. And all code he post is free to use. The only thing he want to say, is that when you change something in the code and it will not work anymore. He is not te person to adress to for the mistakes you made in the code. That the idea behind it.

His work he showed here is hard work for him and he is very happy to accomplished a challange like this.
His idea to make it a library is for people who has use for it.

Bart.

Good work Jamie. :lol:

_________________
From my first self made computer till now I stil like computers.


Top
 Profile  
Reply with quote  
 Post subject: Re: Transer Lib
PostPosted: Tue Aug 28, 2018 3:40 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3624
Location: Netherlands
Thanks for your post Bart.

Jamie, it’s great you want to share something you created.
I know how it feels when something you put effort in is working :)

_________________
macOS 10.15 Catalina, Windows 10


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye