-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from hype/lib_staging
Updating master branch to latest version
- Loading branch information
Showing
612 changed files
with
26,198 additions
and
4,760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import hype.*; | ||
import hype.extended.behavior.HOscillator; | ||
|
||
HDrawablePool pool; | ||
int boxSize = 500; | ||
|
||
void setup() { | ||
size(640,640,P3D); | ||
H.init(this).background(#242424).use3D(true); | ||
|
||
pool = new HDrawablePool(1); | ||
pool.autoAddToStage() | ||
.add(new HBox().texture("tex.png")) | ||
.onCreate( | ||
new HCallback() { | ||
public void run(Object obj) { | ||
int i = pool.currentIndex(); | ||
|
||
HBox d = (HBox) obj; | ||
d.depth(boxSize).width(boxSize).height(boxSize).strokeWeight(2).stroke(0,225).fill(255,225).x(width/2).y(height/2).z(-500); | ||
|
||
new HOscillator().target(d).property(H.ROTATIONX).range(-360, 360).speed(0.1).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONY).range(-360, 360).speed(0.2).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONZ).range(-360, 360).speed(0.3).freq(1).currentStep(i); | ||
} | ||
} | ||
) | ||
.requestAll() | ||
; | ||
} | ||
|
||
void draw() { | ||
/* | ||
Be wary when using these hints, they are there to help with z depth clipping issues. | ||
They can have performance issues when there's a lot of overlapping objects on screen. | ||
*/ | ||
hint(DISABLE_DEPTH_TEST); | ||
hint(ENABLE_DEPTH_SORT); | ||
|
||
lights(); | ||
H.drawStage(); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import hype.*; | ||
import hype.extended.behavior.HOscillator; | ||
|
||
HDrawablePool pool; | ||
int boxSize = 500; | ||
|
||
void setup() { | ||
size(640,640,P3D); | ||
H.init(this).background(#242424).use3D(true); | ||
|
||
HBox b = new HBox(); | ||
b.textureFront("tex1.png"); | ||
b.textureBack("tex2.png"); | ||
b.textureTop("tex3.png"); | ||
b.textureBottom("tex4.png"); | ||
b.textureLeft("tex5.png"); | ||
b.textureRight("tex6.png"); | ||
|
||
pool = new HDrawablePool(1); | ||
pool.autoAddToStage() | ||
.add(b) | ||
.onCreate( | ||
new HCallback() { | ||
public void run(Object obj) { | ||
int i = pool.currentIndex(); | ||
|
||
HBox d = (HBox) obj; | ||
d.depth(boxSize).width(boxSize).height(boxSize).strokeWeight(2).stroke(0,225).fill(255,225).x(width/2).y(height/2).z(-500); | ||
|
||
new HOscillator().target(d).property(H.ROTATIONX).range(-360, 360).speed(0.1).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONY).range(-360, 360).speed(0.2).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONZ).range(-360, 360).speed(0.3).freq(1).currentStep(i); | ||
} | ||
} | ||
) | ||
.requestAll() | ||
; | ||
} | ||
|
||
void draw() { | ||
/* | ||
Be wary when using these hints, they are there to help with z depth clipping issues. | ||
They can have performance issues when there's a lot of overlapping objects on screen. | ||
*/ | ||
hint(DISABLE_DEPTH_TEST); | ||
hint(ENABLE_DEPTH_SORT); | ||
|
||
lights(); | ||
H.drawStage(); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import hype.*; | ||
import hype.extended.behavior.HOscillator; | ||
|
||
HDrawablePool pool; | ||
int boxSize = 500; | ||
|
||
void setup() { | ||
size(640,640,P3D); | ||
H.init(this).background(#242424).use3D(true); | ||
|
||
HBox b = new HBox(); | ||
b.texture("tex.png"); | ||
b.textureFront("tex1.png"); // "texture" sets all 6 faces, calling a single specfic face... overrides that face | ||
b.textureBack("tex2.png"); | ||
|
||
// textures "tex1" and "tex2" by https://www.instagram.com/matthewcurry/ | ||
|
||
pool = new HDrawablePool(1); | ||
pool.autoAddToStage() | ||
.add(b) | ||
.onCreate( | ||
new HCallback() { | ||
public void run(Object obj) { | ||
int i = pool.currentIndex(); | ||
|
||
HBox d = (HBox) obj; | ||
d.depth(boxSize).width(boxSize).height(boxSize).strokeWeight(2).stroke(0,225).fill(255,225).x(width/2).y(height/2).z(-500); | ||
|
||
new HOscillator().target(d).property(H.ROTATIONX).range(-360, 360).speed(0.1).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONY).range(-360, 360).speed(0.2).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONZ).range(-360, 360).speed(0.3).freq(1).currentStep(i); | ||
} | ||
} | ||
) | ||
.requestAll() | ||
; | ||
} | ||
|
||
void draw() { | ||
/* | ||
Be wary when using these hints, they are there to help with z depth clipping issues. | ||
They can have performance issues when there's a lot of overlapping objects on screen. | ||
*/ | ||
hint(DISABLE_DEPTH_TEST); | ||
hint(ENABLE_DEPTH_SORT); | ||
|
||
lights(); | ||
H.drawStage(); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import hype.*; | ||
import hype.extended.behavior.HOscillator; | ||
|
||
HDrawablePool pool; | ||
int boxSize = 500; | ||
|
||
void setup() { | ||
size(640,640,P3D); | ||
H.init(this).background(#242424).use3D(true); | ||
|
||
HBox b = new HBox(); | ||
b.textureFront("tex1.png"); | ||
b.textureBack("tex2.png"); | ||
b.textureTop("tex3.png"); | ||
b.textureBottom("tex4.png"); | ||
b.textureLeft("tex5.png"); | ||
b.textureRight("tex6.png"); | ||
|
||
pool = new HDrawablePool(25); | ||
pool.autoAddToStage() | ||
.add(b) | ||
.onCreate( | ||
new HCallback() { | ||
public void run(Object obj) { | ||
int i = pool.currentIndex(); | ||
|
||
HBox d = (HBox) obj; | ||
d.depth(boxSize).width(boxSize).height(boxSize).strokeWeight(2).stroke(0,225).fill(255,225).x(width/2).y(height/2).z(-500); | ||
|
||
new HOscillator().target(d).property(H.ROTATIONX).range(-360, 360).speed(0.1).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONY).range(-360, 360).speed(0.2).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONZ).range(-360, 360).speed(0.3).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.SCALE).range(0.5, 1.0).speed(1).freq(2).currentStep(i); | ||
} | ||
} | ||
) | ||
.requestAll() | ||
; | ||
} | ||
|
||
void draw() { | ||
lights(); | ||
H.drawStage(); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import hype.*; | ||
import hype.extended.behavior.HOscillator; | ||
import hype.extended.colorist.HPixelColorist; | ||
|
||
HDrawablePool pool; | ||
int boxSize = 500; | ||
|
||
HImage clrSRC; | ||
HPixelColorist clrHPC; | ||
|
||
void setup() { | ||
size(640,640,P3D); | ||
H.init(this).background(#242424).use3D(true); | ||
|
||
H.add( clrSRC = new HImage("color.png") ); | ||
clrHPC = new HPixelColorist(clrSRC); | ||
|
||
HBox b = new HBox(); | ||
b.textureFront("tex1.png"); | ||
b.textureBack("tex2.png"); | ||
b.textureTop("tex3.png"); | ||
b.textureBottom("tex4.png"); | ||
b.textureLeft("tex5.png"); | ||
b.textureRight("tex6.png"); | ||
|
||
pool = new HDrawablePool(50); | ||
pool.autoAddToStage() | ||
.add(b) | ||
.onCreate( | ||
new HCallback() { | ||
public void run(Object obj) { | ||
int i = pool.currentIndex(); | ||
|
||
HRect marker; | ||
H.add( marker = new HRect(2,10) ); | ||
marker.noStroke().fill(#CCCCCC).loc(0,15); | ||
new HOscillator().target(marker).property(H.X).range(0, clrSRC.width()).speed(1).freq(1).currentStep(i*2); | ||
|
||
HBox d = (HBox) obj; | ||
d.depth(boxSize).width(boxSize).height(boxSize).strokeWeight(2).stroke(0,225).fill(255,225).x(width/2).y(height/2).z(-500); | ||
d.extras( new HBundle().obj("m", marker) ); | ||
|
||
new HOscillator().target(d).property(H.ROTATIONX).range(-360, 360).speed(0.1).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONY).range(-360, 360).speed(0.2).freq(1).currentStep(i); | ||
new HOscillator().target(d).property(H.ROTATIONZ).range(-360, 360).speed(0.3).freq(1).currentStep(i); | ||
} | ||
} | ||
) | ||
.requestAll() | ||
; | ||
} | ||
|
||
void draw() { | ||
lights(); | ||
H.drawStage(); | ||
|
||
for (HDrawable d : pool) { | ||
HBundle obj = d.extras(); | ||
HRect marker = (HRect) obj.obj("m"); | ||
|
||
int tempPos = (int)constrain(marker.x(), 0, clrSRC.width()-1); | ||
color tempColor = clrHPC.getColor(tempPos,0); | ||
d.fill(tempColor); | ||
} | ||
} |
Binary file renamed
BIN
+17.6 KB
examples/HSprite/HSprite_004/data/color.png → HYPE/examples/HBox/HBox_013/data/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import hype.*; | ||
import hype.extended.behavior.HOscillator; | ||
import hype.extended.colorist.HPixelColorist; | ||
import hype.extended.layout.HGridLayout; | ||
|
||
int gridX = 5; | ||
int gridY = 5; | ||
int gridZ = 5; | ||
int gridMax = gridX * gridY * gridZ; | ||
|
||
HDrawablePool pool; | ||
int boxSize = 200; | ||
|
||
HImage clrSRC; | ||
HPixelColorist clrHPC; | ||
|
||
void setup() { | ||
size(640,640,P3D); | ||
H.init(this).background(#242424).use3D(true); | ||
|
||
H.add( clrSRC = new HImage("color.png") ).visibility(false); | ||
clrHPC = new HPixelColorist(clrSRC); | ||
|
||
pool = new HDrawablePool(gridMax); | ||
pool.autoAddToStage() | ||
.add(new HBox().texture("tex.png")) | ||
.layout (new HGridLayout().startX(-400).startY(-400).startZ(-400).spacing(400, 400, 400).rows(gridX).cols(gridY)) | ||
.onCreate( | ||
new HCallback() { | ||
public void run(Object obj) { | ||
int i = pool.currentIndex(); | ||
|
||
HRect marker; | ||
H.add( marker = new HRect(2,10) ); | ||
marker.noStroke().fill(#CCCCCC).loc(0,15).visibility(false); | ||
new HOscillator().target(marker).property(H.X).range(0, clrSRC.width()).speed(1).freq(1).currentStep(i*2); | ||
|
||
HBox d = (HBox) obj; | ||
d.depth(boxSize).width(boxSize).height(boxSize).strokeWeight(2).stroke(0,225).fill(255,225); | ||
d.extras( new HBundle().obj("m", marker) ); | ||
|
||
new HOscillator().target(d).property(H.ROTATIONX).range(-360, 360).speed(0.1).freq(1).currentStep(i*0.25); | ||
new HOscillator().target(d).property(H.ROTATIONY).range(-360, 360).speed(0.2).freq(1).currentStep(i*0.25); | ||
new HOscillator().target(d).property(H.ROTATIONZ).range(-360, 360).speed(0.3).freq(1).currentStep(i*0.25); | ||
} | ||
} | ||
) | ||
.requestAll() | ||
; | ||
} | ||
|
||
void draw() { | ||
lights(); | ||
|
||
pushMatrix(); | ||
translate(width/2, height/2, -200); | ||
rotateY( radians(frameCount) ); | ||
H.drawStage(); | ||
popMatrix(); | ||
|
||
for (HDrawable d : pool) { | ||
HBundle obj = d.extras(); | ||
HRect marker = (HRect) obj.obj("m"); | ||
|
||
int tempPos = (int)constrain(marker.x(), 0, clrSRC.width()-1); | ||
color tempColor = clrHPC.getColor(tempPos,0); | ||
d.fill(tempColor); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.