[ Prev | Index | Next ]
Japanese English

XvCg`

_[`s@ɂ́A܂łɈĂڕ`̑ɁA XvCg`Ƃ@݂܂Bł́ÃXvCg`ɂ‚Đ܂B

X|T[N


XvCg`

XvCg`Ƃ́A{Q[Ȃǂł 2DCG SɁAn[hEFAŎĂ̋@\A \tgEFAIɎ̂łB XvCg`̊TÓAAjf̐ߒɂA Z̊TOƔɂ悭Ă܂B ̓Iɂ́A܂`悷}`摜̐A XvCgƌĂ΂uwv_[ɓo^Ă܂B āA`掞ɂ̃XvCg_[ŏd˂čA1 ̊G𐶐܂B

XvCg`悪ɈЗ͂𔭊̂́A Aj[VȂǂsłB Ⴆ΁AAj[V̒ɁÂƓȂ̂Ƃ܂傤B ̏ꍇAʂɕ\G𒼐ڕ`ŗpӂƁAAj[Ṽt[Ɂu ܂wiNAA đSĂ̐}`摜 draw n֐ŕ`悷 vƂsȂ΂Ȃ܂B

ŃXvCg`gpƁA ŏɑSĂ̐}`摜XvCgƂēo^ĂAƂ͖̕`掞ɁA XvCg𓮂΍ςނ̂ŁAvŐLqVvɂȂꍇ܂B

ȂAXvCg`́Axʂłڕ`菭LłBApn[hEFAł̕`ȂƂAVCSSL̂悤ȃXNvgł̕`@\ɂẮAقǃXvCggi`\ȂǁjłȂACɂقǂ̑̊͐܂BPɁAǂ̕R[hVvɏ邩Ƃϓ_őIׂOKłB

XvCg̊{

ڕ`ƈقȂAXvCg̓vOsɓA FςȂǁAIɊp܂B ŁA̓IȃXvCg̐OɁA XvCg𓮓IɊp邽߂̊{ɂ‚ďqׂĂ܂B

XvCg̐

ۂ̃XvCgɂ͗lXȎނ̂̂܂A͑Snew`Sprite ֐Ő ܂B`̕ɂ̓XvCg̎ނɌŗL̖̂܂B̓IȐ͎͂ň܂B

- ֐̌` -
int new`Sprite ( ` )

̊֐́AXvCg𐶐ÃXvCgɌŗL̎ʔԍłuXvCgIDvԂ܂B

XvCg̓o^

XvCǵA_[ɓo^ȂΕ`悳܂B _[ɃXvCgo^ɂ́AmountSprite ֐gp܂B

- ֐̌` -
void mountSprite ( int spriteID, int rendererID )

͈ȉ̒ʂłF

  • spriteID: o^XvCg̃XvCgID w肵܂B
  • rendererID: o^惌_[ID w肵܂B

XvCg̕`

_[ɂׂẴXvCgo^A ̃XvCgdˍ킹čA1 ̃OtBbNXɕ`悷Kv܂B ɂ paintGraphics2D ֐gp܂B

- ֐dl -
void paintGraphics2D ( int rendererID )

͈ȉ̒ʂłF

  • rendererID: _[IDw肵܂B

̊֐R[܂ŁAXvCg͍̍sȂ̂łӂB

eXvCg

XvCgɂ́A􉽊w}``悷́A eLXg`悷́A摜`悷̂ȂǁAlXȎނ݂̂̂܂B ȉł́AeXvCg̐Ǝgp@܂B

ȂAȉɓoꂷ֐͑SāA߂lƂāAXvCgIDԂ܂B

_XvCg

_XvCg𐶐ɂ́AnewPointSprite ֐gp܂B

- ֐̌` -
int newPointSprite ( int x, int y, int radius )

͈ȉ̒ʂłF

  • x, y: _̍Ww肵܂B
  • radius: _̔aw肵܂B

XvCg

XvCg𐶐ɂ́AnewLineSprite ֐gp܂B

- ֐̌` -
int newLineSprite ( int x1, int y1, int x2, int y2 )

͈ȉ̒ʂłF

  • x1, x2: ̎n_̍Ww肵܂B
  • x2, y2: ̏I_̍Ww肵܂B

`XvCg

`XvCg𐶐ɂ́AnewRectangleSprite ֐gp܂B

- ֐̌` -
int newRectangleSprite ( int x, int y, int width, int height, bool fill )

͈ȉ̒ʂłF

  • x, y: 㒸_̍Ww肵܂B
  • width, height: ƍw肵܂B
  • fill: true ̏ꍇɓh‚Ԃ`Afalse ̏ꍇɋÊ݂̕`ƂȂ܂B

ȉ~XvCg

ȉ~XvCg𐶐ɂ́AnewEllipseSprite ֐gp܂B

- ֐̌` -
int newEllipseSprite ( int x, int y, int width, int height, bool fill )

͈ȉ̒ʂłF

  • x, y: Oڒ`̍㒸_̍Ww肵܂B
  • width, height: Oڒ`̕ƍw肵܂B
  • fill: true ̏ꍇɓh‚Ԃ`Afalse ̏ꍇɋÊ݂̕`ƂȂ܂B

ȉ~́AŎw肵`̈ɓڂ悤ɕ`悳܂B

p`XvCg

p`XvCg𐶐ɂ́AnewPolygonSprite ֐gp܂B

- ֐̌` -
int newPolygonSprite ( int x[ ], int y[ ], bool fill )

͈ȉ̒ʂłF

  • x[], y[]: p`\钸_̍WAzŎw肵܂B
  • fill: true ̏ꍇɓh‚Ԃ`Afalse ̏ꍇɋÊ݂̕`ƂȂ܂B

܂XvCg

܂XvCg𐶐ɂ́AnewPolylineSprite ֐gp܂B

- ֐̌` -
int newPolylineSprite ( int x[ ], int y[ ] )

͈ȉ̒ʂłF

  • x[], y[]: p`\钸_̍WAzŎw肵܂B

eLXgXvCg

eLXgXvCg𐶐ɂ́AnewTextSprite ֐gp܂B

- ֐̌` -
int newTextSprite ( int x, int y, int lineWidth, int lineHeight, string text )

͈ȉ̒ʂłF

  • x, y: eLXgn_̃A_[Cij̍Ww肵܂BW͉ʍ_( 0, 0 )ƂAEX AY Ŏw肵܂B
  • lineWidth, lineHeight: eLXg̍sƍsԊuw肵܂B`掞ɍs𒴂eLXǵAʼnsĎ̍sɕ`悳܂B
  • text: \eLXge

tHgTCY̐ݒ

eLXg̕`ɎgptHg̑傫ύXꍇ́AsetSpriteFontSize ֐gp܂B

- ֐̌` -
void setSpriteFontSize ( int spriteID, int fontSize )

͈ȉ̒ʂłF

  • spriteID: XvCgID w肵܂B
  • fontSize: tHg̑傫pti|CgAʼnjPʂŎw肵܂B

pt Ƃ̂̓tHg̑傫w肷ʓIȒPʂŁAʕ\ۂɈ‚̊ƂȂ̂͑12pt Oł傤B10pt ƂׂA15pt Ə傫߂̕ƂȂ܂BŒӂȂ΂ȂȂ̂́A1pt sNZɑΉ邩Ƃ̂͊‹ɂĈقȂƂ_łBقȂ鎖͂܂񂪁Aꕶ萔sNZ鎖͂悭܂B]āAeLXg`悷ۂ́A܂VrAł͂ȂAx鎖z肵CAEg鎖܂B

摜XvCg

摜XvCg𐶐ɂ́AnewImageSprite ֐p܂B

- ֐dl -
int newImageSprite (
  int x, int y, int width, int height, int graphicsID
)

͈ȉ̒ʂłF

  • x, y: 摜`悷鍶㒸_̍Ww肵܂B
  • width, height: 摜`悷镝ƍw肵܂B
  • graphicsID: `悷摜e\OtBbNXf[^ID w肵܂B

x, x ɂ́A摜`悷鍶㒸_̍WAwidth, height ɂ͕ƍw肵܂BŌ̈graphicsID ɂ́A`悷OtBbNXf[^ID w肵܂B

Ɏw肷OtBbNXf[^IDɂ́AGraphicsCunewGraphics( string fileName )֐ʼn摜t@Cǂݍ񂾂̂Aʂ̃_[ŕ`悵̂Ȃǂpł܂B

vO

ł́Aňe`֐gpĂ݂܂傤Bȉ̂悤ɋLqAsĂ݂ĂB

ȂA摜̕`sꍇ́AvOƓtH_ɁuTest.pngvƂOPNG `摜t@CuĂsĂi炩_E[hł܂jB


import Graphics;
import Graphics2D;
import GUI;

// OtBbNXf[^ƃ_[̐
int graphicsID = newGraphics( );
int rendererID = newGraphics2DRenderer( 800, 600, graphicsID );

// \ʂ̐
int windowID = newWindow( 0, 0, 800, 600, " Hello 2DCG ! " );
int labelID = newImageLabel( 0, 0, 800, 600, graphicsID );
mountComponent( labelID, windowID );

// wiF𔒂ɐݒ肵ăNA
setGraphics2DColor( rendererID, 255, 255, 255, 255 );
clearGraphics2D( rendererID );



// =========================
// `揈 
// =========================


// (0,0)(100,100)ԐXvCg𐶐iԐFj
int lineSpriteID = newLineSprite( 0, 0, 100, 100 );
setSpriteColor( lineSpriteID, 255, 0, 0, 255 );
mountSprite( lineSpriteID, rendererID );


// (100,100)(500~300)̒`XvCg𐶐iFj
int rectSpriteID = newRectangleSprite( 100, 100, 500, 300, true );
setSpriteColor( rectSpriteID, 0, 0, 255, 255 );
mountSprite( rectSpriteID, rendererID );


// (100,100)(500~300)̑ȉ~XvCg𐶐iΐFj
int ovalSpriteID = newEllipseSprite( 100, 100, 500, 300, true );
setSpriteColor( ovalSpriteID, 0, 255, 0, 255 );
mountSprite( ovalSpriteID, rendererID );


// p`A܂XvCgpx zAy zp
int x[ 3 ];
x[ 0 ] = 100;
x[ 1 ] = 300;
x[ 2 ] = 300;

int y[ 3 ];
y[ 0 ] = 100;
y[ 1 ] = 100;
y[ 2 ] = 300;


// x zAy z𒸓_Ƃ鑽p`XvCg𐶐iFj
int pgSpriteID = newPolygonSprite( x, y, true );
setSpriteColor( pgSpriteID, 255, 255, 0, 255 );
mountSprite( pgSpriteID, rendererID );


// x zAy z𒸓_Ƃ܂XvCg𐶐iԐFj
int plSpriteID = newPolylineSprite( x, y );
setSpriteColor( plSpriteID, 255, 0, 0, 255 );
mountSprite( plSpriteID, rendererID );


// (100,100)ɃeLXgXvCg𐶐iFj
string text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int txtSpriteID = newTextSprite( 300, 50, 250, 35, text );
setSpriteColor( txtSpriteID, 0, 0, 0, 255 );
setSpriteFontSize( txtSpriteID, 30 );
mountSprite( txtSpriteID, rendererID );


// 摜t@CuTest.pngvǂݍ݁A摜XvCg𐶐
int graphicsID2 = newGraphics( "Test.png" );
int imSpriteID = newImageSprite( 350, 100, 300, 200, graphicsID2 );
mountSprite( imSpriteID, rendererID );


// =========================
// `揈 ܂
// =========================


// o^ĂXvCgĕ`
paintGraphics2D( rendererID );

// ʂ̕`
paintComponent( labelID );
paintComponent( windowID );
Sample.vcssl

̃vOsƁAEBhE\ȀɗlXȐ}`\܂B

s

ɎgptHǵA‹ɂĈقȂ܂BtHg𖾎ꍇɂsetSpriteFont( int SpriteID, string fontName )֐gpĂB



Sponsored Link



Japanese English
Index
News From RINEARN
* VCSSL is developed by RINEARN.

VCSSL 3.4.52 Released: Enhanced Integration with External Programs and More
2025-05-25 - This update introduces enhancements to the external program integration features (e.g., for running C-language executables). Several other improvements and fixes are also included. Details inside.

Released: Latest Version of VCSSL with Fixes for Behavioral Changes on Java 24
2025-04-22 - VCSSL 3.4.50 released with a fix for a subtle behavioral change in absolute path resolution on network drives, introduced in Java 24. Details inside.

Released the Latest Versions of RINEARN Graph and VCSSL - Now Supporting Customizable Tick Positions and Labels!
2024-11-24 - Starting with this update, a new "MANUAL" tick mode is now supported, allowing users to freely specify the positions and labels of ticks on the graph. We'll explain the details and how to use it.

Released Exevalator 2.2: Now Compatible with TypeScript and Usable in Web Browsers
2024-10-22 - The open-source expression evaluation library, Exevalator, has been updated to version 2.2. It now supports TypeScript and can be used for evaluating expressions directly in web browsers. Explains the details.

Behind the Scenes of Creating an Assistant AI (Part 1: Fundamental Knowledge)
2024-10-07 - The first part of a series on how to create an Assistant AI. In this article, we introduce the essential knowledge you need to grasp before building an Assistant AI. What exactly is an LLM-based AI? What is RAG? And more.

Launching an Assistant AI to Support Software Usage!
2024-09-20 - We've launched an Assistant AI that answers questions about how to use RINEARN software and helps with certain tasks. Anyone with a ChatGPT account can use it for free. We'll explain how to use it.

Software Updates: Command Expansion in RINEARN Graph, and English Support in VCSSL
2024-02-05 - We updated our apps. This updates include "Enhancing the Command-Line Features of RINEARN Graph" and "Adding English Support to VCSSL." Dives into each of them!

Inside the Repetitive Execution Speedup Impremented in Vnano Ver.1.1
2024-01-17 - Delves into the update in Vnano 1.1 from a developer's viewpoint, providing detailed insights into the specific improvements made to the internal structure of the script engine.