It is currently Thu Nov 26, 2020 2:49 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [Done] Rotated sprites will not be displayed on screen edge
PostPosted: Thu Sep 05, 2013 10:00 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 11, 2004 7:07 am
Posts: 644
If you rotate (and zoom?) a sprite and display (move) it near the edge on the screen, the sprite is invisible, before it leaves the screen. I think this is an incorrect checking routine for rotated sprites ("sprite is on screen"):

http://www.purebasic.fr/english/viewtopic.php?f=13&t=56082


Top
 Profile  
Reply with quote  
 Post subject: Re: Rotated sprites will not be displayed on the edge of the
PostPosted: Fri Sep 06, 2013 12:22 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14179
Location: France
Could you post a snippet ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Rotated sprites will not be displayed on the edge of the
PostPosted: Wed Nov 13, 2013 6:02 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 11, 2004 7:07 am
Posts: 644
change the position from 1270 to 1290 (left right keys) and you will see curious things...

The right sprite disappears and the left sprite jumps from a wrong y position to the correct position :shock: :?:
If you comment the line with RotateSprite(), all seems OK!

With Windows, the y position is correct, but the sprite also disappears too early.

Code:
#Sprite = 0

InitSprite()
InitKeyboard()

OpenScreen(1280, 800, 32, "")

SpriteQuality(#PB_Sprite_BilinearFiltering)

TransparentSpriteColor(#PB_Any, $FF00FF)
LoadSprite(#Sprite, #PB_Compiler_Home + "examples/sources/Data/Background.bmp")

px = 1270

Repeat

  ExamineKeyboard()

  ClearScreen($FFBF00)

  ZoomSprite(#Sprite, 600, 600)
  RotateSprite(#Sprite, 45, #PB_Absolute)
 
  ; Same y Position!!
  DisplayTransparentSprite(#Sprite, px, 100)
  DisplayTransparentSprite(#Sprite, px - 1280, 100)

  If KeyboardPushed(#PB_Key_Right): px + 1: EndIf
  If KeyboardPushed(#PB_Key_Left): px - 1: EndIf

  StartDrawing(ScreenOutput())
  DrawText(10, 10, Str(px))
  StopDrawing()

  FlipBuffers()

Until KeyboardPushed(#PB_Key_Escape)


Top
 Profile  
Reply with quote  
 Post subject: Re: Rotated sprites will not be displayed on the edge of the
PostPosted: Wed Apr 02, 2014 10:21 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 11, 2004 7:07 am
Posts: 644
This bug (?) following me in some projects.
Can anyone confirm this or is this a problem of my graphic card?


Top
 Profile  
Reply with quote  
 Post subject: Re: Rotated sprites will not be displayed on the edge of the
PostPosted: Sun Feb 09, 2020 4:29 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14179
Location: France
Fixed


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] Rotated sprites will not be displayed on screen e
PostPosted: Tue May 05, 2020 7:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Apr 30, 2009 5:23 pm
Posts: 336
Location: Côtes d'Azur, France
Thank you so much !!

_________________
There are 2 methods to program bugless.
But only the third works fine.

Win10, Pb x64 5.71 LTS


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 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