Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
timaxa007 написал(а):Создавай новые переменные текстур и переменную которая будет значения, сколько времени прошло от начало показа первой текстуры, затем в бинде текстуры менять текстуры каждые "30-60 сек.".
timaxa007 написал(а):Эм... И зачем такое?
int t = 1;
while(t<60){
++t;
System.out.println(t);
}
timaxa007 написал(а):Да, но это не то, update метод нужен.
int t = 0;
/**
* Called from the main game loop to update the screen.
*/
@Override
public void updateScreen() {
++t;
if (t >= 96000)
t = 0;
}
А он в тиках измеряет?timaxa007 написал(а):Код:int t = 0; /** * Called from the main game loop to update the screen. */ @Override public void updateScreen() { ++t; if (t >= 96000) t = 0; }
Вызывается из основного цикла игры для обновления экрана.
timaxa007 написал(а):Ну, почти. Написано-же в комментарии:
Вызывается из основного цикла игры для обновления экрана.
public static final ResourceLocation
bg1 = new ResourceLocation("textures/gui/title/bg.png"),
bg2 = new ResourceLocation("textures/gui/title/bg2.png");
int t = 0;
/**
* Called from the main game loop to update the screen.
*/
@Override
public void updateScreen() {
++t;
if (t >= 20 * 60 * 2)
t = 0;
}
//где используется у тебя используеться mc.getTextureManager().bindTexture, типа того писать
mc.getTextureManager().bindTexture((t >= 20 * 60 ? bg1 : bg2))
timaxa007 написал(а):Код:public static final ResourceLocation bg1 = new ResourceLocation("textures/gui/title/bg.png"), bg2 = new ResourceLocation("textures/gui/title/bg2.png"); int t = 0; /** * Called from the main game loop to update the screen. */ @Override public void updateScreen() { ++t; if (t >= 20 * 60 * 2) t = 0; } //где используется у тебя используеться mc.getTextureManager().bindTexture, типа того писать mc.getTextureManager().bindTexture((t >= 20 * 60 ? bg1 : bg2))
timaxa007 написал(а):Лучше png, с jpg он вроде плохо работает или во-обще не работает.
timaxa007 написал(а):Последнее нужно типа по другому.
int p = (20 * 60) / 3;
mc.getTextureManager().bindTexture((p == 1 ? bg1 : p == 2 ? bg2 : bg));
[font=Monaco, Consolas, Courier, monospace]int p = (20 * 60) / 4;[/font]timaxa007 написал(а):Что-то типа этого:
Код:int p = (20 * 60) / 3; mc.getTextureManager().bindTexture((p == 1 ? bg1 : p == 2 ? bg2 : bg));
private static final ResourceLocation[] RES = new ResourceLocation[] {
new ResourceLocation("textures/gui/title/bg.png"),
new ResourceLocation("textures/gui/title/bg2.png")
}
private int time = 0;
private int index = 0;
@Override
public void updateScreen() {
if (++time > 20 * 60)
t = 0;
if (++index >= RES.length) {
index = 0;
}
}
}
//где используется у тебя используеться mc.getTextureManager().bindTexture, типа того писать
mc.getTextureManager().bindTexture(RES[index])