Rotated Sprite Bug PB561 tested x64 /x86 - all OS
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
The only thing I can think of, if you don't want to create your own procedure. Fred could possibly create a #PB_Recenter combination flag for RotateSprite(). Something that would auto calculate the center for non-power of 2 sprites.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
ThanksJHPJHP wrote: Try the following:
- UnClipping the Sprite not needed: ClipSprite(FA,#PB_Default,#PB_Default,#PB_Default,#PB_Default)Code: Select all
... RotateSprite(FA,0.5,#PB_Relative) ClipSprite(FA,0,0,400,150) ; Added ClipSprite HERE DisplayTransparentSprite(FA,400,150) ClipSprite(FA,0,0,400,150) ; Added ClipSprite HERE DisplayTransparentSprite(FA,400,150,200,#Red) ClipSprite(FA,0,10,18,18) DisplayTransparentSprite(FA,400,350) DisplayTransparentSprite(FA,400,350,200,#Yellow) ...
I will use this workaround until the issue is officially solved.
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
@J.Baker
Yep, but, this solve not the negative y output bug
Rotated sprites which coming in from above, you don't see as long as y is negative
This is for gaming a no-go
Yep, but, this solve not the negative y output bug
Rotated sprites which coming in from above, you don't see as long as y is negative
This is for gaming a no-go
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
Does this help? Oddly, non-power of 2 scale up to 2048x2048 on my Mac.
Code: Select all
;PureBasic 5.44 LTS
InitSprite()
Procedure RotateOffset(Sprite, X, Y, Angle, Absolute = #False)
Static Degree = 0
Degree + Angle
If Degree >= 360
Degree = 0
EndIf
If Absolute = #True
RotateSprite(Sprite, Angle, #PB_Absolute)
Else
RotateSprite(Sprite, Angle, #PB_Relative)
EndIf
DisplaySprite(Sprite, X + Cos(Radian(Degree)) * SpriteWidth(Sprite) / 2048, Y + Sin(Radian(Degree)) * SpriteHeight(Sprite) / 2048)
EndProcedure
OpenWindow(0, 0, 0, 800, 600, "Rotate Sprite Offset", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, 800, 600, 0, 0, 0)
CreateSprite(1, 600, 100)
StartDrawing(SpriteOutput(1))
Box(0,0,600,100,$FF0000)
StopDrawing()
CopySprite(1, 2)
CopySprite(1, 3)
Repeat
Event = WindowEvent()
ClearScreen(0)
RotateOffset(1, 0, 0, 10, #True)
Delay(10)
ZoomSprite(2, 64, 64)
RotateOffset(2, 160, 160, 1, #False)
RotateOffset(3, 0, 300, 3, #False)
FlipBuffers()
Until Event = #PB_Event_CloseWindow
Last edited by J. Baker on Tue Oct 17, 2017 6:04 pm, edited 1 time in total.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
@J.Baker
Yep, this looking good
Yep, this looking good
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
I just want to mention in the procedure by J. Baker there seems to be left some redundant code that probably got there in the process:
Code: Select all
.. - (SpriteWidth(Sprite) / 2 - SpriteWidth(Sprite) / 2) .. - (SpriteHeight(Sprite) / 2 - SpriteHeight(Sprite) / 2)
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
@NULL
PB calculate the needed new size after rotating not
I must working to time, i will looking again later
PB calculate the needed new size after rotating not
I must working to time, i will looking again later
Code: Select all
; This is not needed :
SpriteWidth(Sprite) / 2 - SpriteWidth(Sprite) / 2), it results zero
; This is the resulted line :
DisplaySprite(Sprite, X + Cos(Radian(Degree)) * SpriteWidth(Sprite) / 2048, Y + Sin(Radian(Degree)) * SpriteHeight(Sprite) / 2048)
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
It looks like I did. I wrote it up quickly and it took me a couple tries before it started working. I didn't go back and verify the math.#NULL wrote:I just want to mention in the procedure by J. Baker there seems to be left some redundant code that probably got there in the process:
I updated the code above. Thanks for pointing that out though and cleaning that line of code up.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
@J.Baker
This is a nice workaround from you
This is a nice workaround from you
Re: Rotated Sprite Bug PB561 tested x64 /x86 - all OS
No problem.walbus wrote:@J.Baker
This is a nice workaround from you
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.