Difference between revisions of "PRINTMODE"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
m
imported>SMcNeill
(style guidelines)
 
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
The '''_PRINTMODE''' statement sets the text or [[_FONT]] printing mode on a background image when using [[PRINT]] or [[_PRINTSTRING]].
+
{{DISPLAYTITLE:_PRINTMODE}}
 +
The [[_PRINTMODE]] statement sets the text or [[_FONT]] printing mode on a background image when using [[PRINT]] or [[_PRINTSTRING]].
  
  
 +
{{PageSyntax}}
 +
: [[_PRINTMODE]] {''_KEEPBACKGROUND''|''_ONLYBACKGROUND''|''_FILLBACKGROUND''}[, {{Parameter|imageHandle&}}]
  
{{PageSyntax}}
+
 
:<code>{{KW|_PRINTMODE}} {{Parameter|mode}}[,{{Parameter|image_handle}}]</code>
+
{{Parameters}}
 +
* One of 3 mode keywords is mandatory when using this statement to deal with the text background.
 +
**''_KEEPBACKGROUND'' (mode 1): Text background transparent. Only the text is displayed over anything behind it.
 +
**''_ONLYBACKGROUND'' (mode 2): Text background only is displayed. Text is transparent to anything behind it.
 +
**''_FILLBACKGROUND'' (mode 3): Text and background block anything behind them like a normal [[PRINT]]. '''Default setting.'''
 +
* If the optional {{Parameter|imageHandle&}} is omitted or = 0) it will use the current [[_DEST|destination]] image background.
  
  
 
{{PageDescription}}
 
{{PageDescription}}
* If the image handle is omitted it will use the current destination image background.
+
* Use the [[_PRINTMODE (function)]] to find the current [[_PRINTMODE]] setting mode number.
* One of 3 mode keywords is '''mandatory''' when using this statement to deal with the text background.
+
* '''The _PRINTMODE statement and function can only be used in graphic screen modes, not SCREEN 0'''
 
 
:*'''_KEEPBACKGROUND''' (mode 1): Text background transparent. Only the text is displayed over anything behind it.
 
:*'''_ONLYBACKGROUND''' (mode 2): Text background is only displayed. Text is transparent to anything behind it.
 
:*'''_FILLBACKGROUND''' (mode 3): Text and background block anything behind them like a normal [[PRINT]]. Default setting.
 
* Use the [[_PRINTMODE (function)]] to find the current _PRINTMODE setting mode number.
 
* '''NOTE: The _PRINTMODE statement and function can only be used in graphic screen modes, NOT SCREEN 0'''
 
  
  
 +
{{PageExamples}}
 
''Example:'' Using _PRINTMODE with [[PRINT]] in a graphic screen mode. The background used is CHR$(219) = █
 
''Example:'' Using _PRINTMODE with [[PRINT]] in a graphic screen mode. The background used is CHR$(219) = █
 
{{CodeStart}} '' ''
 
{{CodeStart}} '' ''
 
{{Cl|SCREEN (statement)|SCREEN}} 12
 
{{Cl|SCREEN (statement)|SCREEN}} 12
number = 69
+
{{Cl|COLOR}} 8: {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} {{Cl|STRING$}}(3, 219) 'background  
{{Cl|COLOR}} 8: {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} {{Cl|STRING$}}(4, 219) 'background  
 
 
{{Cl|_PRINTMODE}} _KEEPBACKGROUND
 
{{Cl|_PRINTMODE}} _KEEPBACKGROUND
{{Cl|COLOR}} 15: {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} number
+
{{Cl|COLOR}} 15: {{Cl|LOCATE}} 10, 10: {{Cl|PRINT}} {{Cl|_PRINTMODE}}
{{Cl|END}}'' ''
+
{{Cl|END}} '' ''
 
{{CodeEnd}}
 
{{CodeEnd}}
  
  
 
{{PageSeeAlso}}
 
{{PageSeeAlso}}
*{{KW|_LOADFONT}}
+
* [[_PRINTMODE (function)]]
*{{KW|_NEWIMAGE}}
+
* [[_PRINTSTRING]]
*{{KW|_PRINTMODE (function)}}
+
* [[_LOADFONT]]
 
+
* [[_NEWIMAGE]]
 +
* [[PRINT]], [[_PRINT USING]]
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Latest revision as of 20:04, 8 September 2017

The _PRINTMODE statement sets the text or _FONT printing mode on a background image when using PRINT or _PRINTSTRING.


Syntax

_PRINTMODE {_KEEPBACKGROUND|_ONLYBACKGROUND|_FILLBACKGROUND}[, imageHandle&]


Parameters

  • One of 3 mode keywords is mandatory when using this statement to deal with the text background.
    • _KEEPBACKGROUND (mode 1): Text background transparent. Only the text is displayed over anything behind it.
    • _ONLYBACKGROUND (mode 2): Text background only is displayed. Text is transparent to anything behind it.
    • _FILLBACKGROUND (mode 3): Text and background block anything behind them like a normal PRINT. Default setting.
  • If the optional imageHandle& is omitted or = 0) it will use the current destination image background.


Description

  • Use the _PRINTMODE (function) to find the current _PRINTMODE setting mode number.
  • The _PRINTMODE statement and function can only be used in graphic screen modes, not SCREEN 0


Examples

Example: Using _PRINTMODE with PRINT in a graphic screen mode. The background used is CHR$(219) = █

SCREEN 12 COLOR 8: LOCATE 10, 10: PRINT STRING$(3, 219) 'background _PRINTMODE _KEEPBACKGROUND COLOR 15: LOCATE 10, 10: PRINT _PRINTMODE END


See also



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page