- This wiki is out of date, use the continuation of this wiki instead
Blendop new
From FenixWiki
(Difference between revisions)
Revision as of 16:42, 17 January 2008 (edit) Sandman (Talk | contribs) ← Previous diff |
Current revision (23:16, 17 January 2008) (edit) (undo) Sandman (Talk | contribs) |
||
(2 intermediate revisions not shown.) | |||
Line 5: | Line 5: | ||
'''INT''' blendop_new ( ) | '''INT''' blendop_new ( ) | ||
- | Creates a new | + | Creates a new [[blend table]]. This table will contain a blending effect, which you'll have to set afterwards, using the various functions. When that is done you can finally [[blendop_apply|apply]] or [[blendop_assign|assign]] the blend table to a [[graphic]]. |
The source section of the [[blend table]] will be the normal object and the destination section will be cleared, removing translucency. | The source section of the [[blend table]] will be the normal object and the destination section will be cleared, removing translucency. | ||
Line 23: | Line 23: | ||
| Insufficient memory || - There is insufficient memory available. This error doesn't occur often. | | Insufficient memory || - There is insufficient memory available. This error doesn't occur often. | ||
|} | |} | ||
+ | |||
+ | == Example == | ||
+ | <pre> | ||
+ | Program test; | ||
+ | Private | ||
+ | int blendTable; | ||
+ | Begin | ||
+ | |||
+ | set_mode(320,240,16); | ||
+ | |||
+ | x = 160; | ||
+ | y = 120; | ||
+ | |||
+ | graph = new_map(100,100,16); | ||
+ | map_clear(0,graph,RGB(255,255,255)); | ||
+ | |||
+ | blendTable = blendop_new(); | ||
+ | blendop_tint(blendTable,1,255,0,0); | ||
+ | |||
+ | Repeat | ||
+ | if (key(_space)) | ||
+ | blendop_assign(0,graph,blendTable); | ||
+ | else | ||
+ | blendop_assign(0,graph,NULL); | ||
+ | end | ||
+ | frame; | ||
+ | Until(key(_ESC)) | ||
+ | |||
+ | OnExit | ||
+ | |||
+ | unload_map(0,graph); | ||
+ | |||
+ | End | ||
+ | </pre> | ||
+ | |||
+ | Used in example: [[set_mode]](), [[new_map]](), [[map_clear]](), [[blendop_new]](), [[blendop_tint]](), [[key]](), [[blendop_assign]](), [[unload_map]]() | ||
+ | |||
+ | This will result in something like: | ||
+ | |||
+ | [[Image:Blendop.jpg]] | ||
{{Funcbox | {{Funcbox | ||
| category = Blendops | | category = Blendops | ||
}} | }} |
Current revision
Contents |
[edit] Definition
INT blendop_new ( )
Creates a new blend table. This table will contain a blending effect, which you'll have to set afterwards, using the various functions. When that is done you can finally apply or assign the blend table to a graphic.
The source section of the blend table will be the normal object and the destination section will be cleared, removing translucency.
[edit] Returns
0 | - Error: insufficient memory or the screen was not yet initialized. |
!0 | - Success (pointer to the blend table). |
[edit] Notes
The right order of doing blending stuff: First create a new table with blendop_new(), then put a blending effect in it with for example blendop_tint(), and then assign it to a graphic with blendop_assign().
[edit] Errors
Insufficient memory | - There is insufficient memory available. This error doesn't occur often. |
[edit] Example
Program test; Private int blendTable; Begin set_mode(320,240,16); x = 160; y = 120; graph = new_map(100,100,16); map_clear(0,graph,RGB(255,255,255)); blendTable = blendop_new(); blendop_tint(blendTable,1,255,0,0); Repeat if (key(_space)) blendop_assign(0,graph,blendTable); else blendop_assign(0,graph,NULL); end frame; Until(key(_ESC)) OnExit unload_map(0,graph); End
Used in example: set_mode(), new_map(), map_clear(), blendop_new(), blendop_tint(), key(), blendop_assign(), unload_map()
This will result in something like:
Blendops Functions | |
• Blendop_apply() • Blendop_assign() • Blendop_free() • Blendop_grayscale() • Blendop_identity() • Blendop_intensity() • Blendop_new() • Blendop_swap() • Blendop_tint() • Blendop_translucency() • |