BBC BASIC
« Angled text »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:38pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Angled text  (Read 126 times)
KenDown
New Member
Image


member is offline

Avatar




PM


Posts: 49
xx Angled text
« Thread started on: Feb 18th, 2018, 08:33am »

The routine provided for producing angled text is splendid and I use it a lot in one of my programs. However it would be nice if I could drag the angled text around.

I can drag ordinary text by GCOL3,n and then printing twice, but so far as I can see angled text cannot use GCOL3. The dragging takes place over a picture, so clearing the screen between prints is not an option.

Any ideas?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: Angled text
« Reply #1 on: Feb 18th, 2018, 09:28am »

on Feb 18th, 2018, 08:33am, KenDown wrote:
The dragging takes place over a picture, so clearing the screen between prints is not an option.

Why? A perfectly good approach is to save the 'background' to a bitmap (e.g. a BMP file) so that every frame you can display the background afresh and then draw the angled text over it wherever you wish.

I know - and I entirely share this reaction - that redrawing the entire window's contents from scratch every frame sounds wasteful (and slow), and so it was in the days of the BBC Micro and the Acorn Archimedes. But it's the way virtually all modern animated graphics work, and it's what GPUs are optimised for. So contrary to one's initial expectations doing it that way makes a lot of sense.

If blitting the entire background from a (cached) BMP file isn't fast enough (and you may be pleasantly surprised by just how fast it is) there are faster alternatives available using API calls (e.g. SYS "BitBlt" in BB4W and SYS "SDL_RenderCopy in BBCSDL).

Exclusive-OR plotting is 'old hat', so much so that OpenGLES 2.0 removed that functionality entirely (which is why BBCSDL has to use OpenGLES 1.0). It was once a neat trick to avoid re-drawing the background, but it's just not the way things are usually done these days.

Richard.
User IP Logged

KenDown
New Member
Image


member is offline

Avatar




PM


Posts: 49
xx Re: Angled text
« Reply #2 on: Feb 18th, 2018, 4:32pm »

Or, I suppose, one could save a small area of the screen and restore it. I do do that for my scrolling text routine, but there the "bounding box" is easy - a single line across the screen.

Is there any way of finding the bounding box of some angled text?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: Angled text
« Reply #3 on: Feb 18th, 2018, 5:28pm »

on Feb 18th, 2018, 4:32pm, KenDown wrote:
Is there any way of finding the bounding box of some angled text?

If GDI is working properly, it should always update the 'system' bounding box, i.e. the one accessed by the SetBoundsRect and GetBoundsRect APIs.

I say "if GDI is working properly" not because I suspect it isn't - hopefully you can be confident that it will work in 'real' Windows - but because for a long time it didn't work in Wine and this was a major compatibility issue for BB4W. I don't even know for sure that angled text updates the bounding box in Wine now.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls